From: Bill Kelly Date: 2008-09-10T15:26:26+09:00 Subject: Re: Ruby Bug? Windows and UDPSocket and Errno:ENOTCONN From: "John Carter" > > If I have a pair of Win2k Ruby processes bouncing UDP packets back and > forth... > > After awhile one of them dies with Errno::ENOTCONN > > The code works under Linux but not under Win2k, neither on ruby-1.8.6 > nor 1.8.7. > > Any guesses? Suggestions? Workarounds? Replaced connect/syswrite, with send: --- john_carter_udp_enotconn.orig.rb 2008-09-09 23:27:04.491375000 -0700 +++ john_carter_udp_enotconn.rb 2008-09-09 23:27:50.975750000 -0700 @@ -28,7 +28,6 @@ puts 'ok' @send_socket = UDPSocket.new print "Listening on port: #{@send_port}..." - @send_socket.connect(0, @send_port) puts 'ok' do_stuff end @@ -39,7 +38,7 @@ def send puts "Sending message: #{MESSAGE}" - @send_socket.syswrite(MESSAGE) + @send_socket.send(MESSAGE, 0, @host, @send_port) end def receive Hope this helps, Bill