Closed markglenn closed 8 years ago
Both of these concerns are valid and would be fixed, however, I don't think this will be merged in. See https://github.com/Graylog2/gelf-rb/issues/31#issuecomment-103658710
I'm closing this since I don't believe this is the right technique because it's not safe for networks that allows the Graylog server to change IP addresses. If you believe I'm wrong, please re-open.
When sending a datagram, non-bound sockets require a DNS lookup. Instead, bind the socket to the given addresses when creating the socket.
Also, lazily create the socket connections, which allows the notify methods to capture the exceptions as expected. If the sockets are created and bound at initialize, an exception would occur then.
Lastly, allow resetting the connections if the addresses are changed.
Fixes #31