Changeset 573

Show
Ignore:
Timestamp:
11/10/07 16:26:17 (1 year ago)
Author:
blackhedd
Message:

forced the port parameter of EM::Connection#send_datagram to be an Integer.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • version_0/ChangeLog

    r566 r573  
    8383        code. Suggested by Brian Candler. 
    848419Oct07: Set the SO_BROADCAST option automatically on all UDP sockets. 
     8510Nov07: Forced integer conversion of send_datagram's port parameter. 
     86Suggested by Matthieu Riou. 
  • version_0/lib/eventmachine.rb

    r572 r573  
    13941394        # size (typically about 1400 bytes). Some very restrictive WANs 
    13951395        # will either drop or truncate packets larger than about 500 bytes. 
     1396        #-- 
     1397        # Added the Integer wrapper around the port parameter per suggestion by 
     1398        # Matthieu Riou, after he passed a String and spent hours tearing his hair out. 
    13961399        # 
    13971400        def send_datagram data, recipient_address, recipient_port 
    13981401                data = data.to_s 
    1399                 EventMachine::send_datagram @signature, data, data.length, recipient_address, recipient_port 
     1402                EventMachine::send_datagram @signature, data, data.length, recipient_address, Integer(recipient_port) 
    14001403        end 
    14011404