ruby-snmp icon indicating copy to clipboard operation
ruby-snmp copied to clipboard

Make recv and recvfrom non-blocking

Open jmthomas opened this issue 11 years ago • 2 comments

Your UDPTransport#recv and UDPServerTransport#recvfrom both block which can cause a thread deadlock if used in the wrong way. @ryanmelt reimplemented this with non-blocking calls.

jmthomas avatar Dec 02 '13 22:12 jmthomas

Under what circumstances does a deadlock occur? How does this patch fix it?

hallidave avatar Dec 03 '13 00:12 hallidave

I believe this was working around various issues I had encountered using the blocking flavors of socket calls in Ruby. (Like: http://bugs.ruby-lang.org/issues/1805) The fix at the time was to block using select instead of directly on the recv/recvfrom call. Probably not applicable to current patched versions of ruby, but wouldn't hurt either. Up to you whether or not to incorporate.

ghost avatar Dec 03 '13 16:12 ghost