There appears to be a problem with sending 0-length (UDP) datagrams. I have a little UDP server running on port 1392, and when I execute the following client code the server does not receive anything. However if I change it to data="x", the server receives it just fine. EM::run { conn = EM::open_datagram_socket( "", 0 ) data = "" puts "send_datagram( #{data.inspect} )" conn.send_datagram( data, "localhost", 1392 ) } I also tried the following from irb: irb(main):001:0> UDPSocket.new.send( "", 0, "localhost", 1392 ) => 0 ... and the server received the 0-length datagram just fine. I''m doing this on Windows. Any thoughts? Thanks, Mark Z.
On Nov 15, 2007 5:17 PM, Mark Zvilius <zvilius at earthlink.net> wrote:> There appears to be a problem with sending 0-length (UDP) datagrams. I > have a little UDP server running on port 1392, and when I execute the > following client code the server does not receive anything. However if I > change it to data="x", the server receives it just fine. > > EM::run { > conn = EM::open_datagram_socket( "", 0 ) > data = "" > puts "send_datagram( #{data.inspect} )" > conn.send_datagram( data, "localhost", 1392 ) > }Yeah, I just repro''d it. Will post here when fix is available.
On Nov 15, 2007 5:17 PM, Mark Zvilius <zvilius at earthlink.net> wrote:> There appears to be a problem with sending 0-length (UDP) datagrams. I > have a little UDP server running on port 1392, and when I execute the > following client code the server does not receive anything. However if I > change it to data="x", the server receives it just fine. > > EM::run { > conn = EM::open_datagram_socket( "", 0 ) > data = "" > puts "send_datagram( #{data.inspect} )" > conn.send_datagram( data, "localhost", 1392 ) > } >Bug fixed. Sync to the HEAD revision. You will need to recompile, as the bug was in the C++ code.
Works. Thanks. -----Original Message----- From: eventmachine-talk-bounces at rubyforge.org [mailto:eventmachine-talk-bounces at rubyforge.org] On Behalf Of Francis Cianfrocca Sent: Thursday, November 15, 2007 3:14 PM To: eventmachine-talk at rubyforge.org Subject: Re: [Eventmachine-talk] 0-length datagram Bug fixed. Sync to the HEAD revision. You will need to recompile, as the bug was in the C++ code.