When I run the appender on my local Windows machine, it operates like it is sending messages but they are never received by a remote graylog2 server. When I removed the line:
private final SocketAddress loopbackAddress = new InetSocketAddress("localhost", 0);
which was just added in the most recent commit (and just used DatagramSocket's no-arg constructor), it worked just fine.
I also changed the code so that it wouldn't create,use and close a DatagramSocket each time. Instead it opens one and caches it for all subsequent sends. Like this:
private DatagramSocket getDatagramSocket() {
try {
if(datagramSocket == null) {
datagramSocket = new DatagramSocket();
}
return datagramSocket;
} catch (SocketException ex) {
throw new RuntimeException(ex);
}
}
I'm sure the loopbackAddress was added for a reason, but...
When I run the appender on my local Windows machine, it operates like it is sending messages but they are never received by a remote graylog2 server. When I removed the line:
private final SocketAddress loopbackAddress = new InetSocketAddress("localhost", 0);
which was just added in the most recent commit (and just used DatagramSocket's no-arg constructor), it worked just fine.
I also changed the code so that it wouldn't create,use and close a DatagramSocket each time. Instead it opens one and caches it for all subsequent sends. Like this:
private DatagramSocket getDatagramSocket() {
try {
if(datagramSocket == null) {
datagramSocket = new DatagramSocket();
}
return datagramSocket;
} catch (SocketException ex) {
throw new RuntimeException(ex);
}
}
I'm sure the loopbackAddress was added for a reason, but...