Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.

Sending under Windows fails due to new loopback #22

@danfin

Description

@danfin

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions