graylog-labs / gelf-rb

Ruby GELF library (Graylog Extended Log Format)
https://rubygems.org/gems/gelf
MIT License
153 stars 104 forks source link

Pre-bind sockets on creation #36

Closed markglenn closed 8 years ago

markglenn commented 9 years ago

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

markglenn commented 9 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

markglenn commented 8 years ago

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.