UDPSocket.recv should not require connection
--------------------------------------------

                 Key: JRUBY-1428
                 URL: http://jira.codehaus.org/browse/JRUBY-1428
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
            Reporter: Dave Halliday
             Fix For: JRuby 1.0.2, JRuby 1.1.0
         Attachments: udp_recv.diff

The UDPSocket::recv() method throws an exception if it is called on a UDP 
socket that is not connected.  UDP sockets should not require a connection.  I 
noticed this problem because the 'snmp' gem on RubyForge uses recv() so it does 
not work with current versions of JRuby.

The RubyUDPSocket Java class inherits its behavior for the recv() method from 
RubyBasicSocket, but that implementation requires that the socket is connected 
before it is called.  The attached patch overrides the recv() behavior in 
RubyBasicSocket and uses the DatagramChannel receive() method which works for 
connectionless sockets (same as the recvfrom() method in the UDP class).




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to