class EaseEngine::UDPSocket

Public Class Methods

new( *args ) click to toggle source
Calls superclass method EaseEngine::Socket::new
# File lib/ease_engine/socket.rb, line 155
def initialize( *args )
  super
  
  @socket = ::UDPSocket.new
end

Public Instance Methods

recv( max, flags = 0 ) click to toggle source
# File lib/ease_engine/socket.rb, line 169
def recv( max, flags = 0 )
  buf, @dst_addr = recvfrom( max, flags )
  buf
end
send( msg, flags, *args ) click to toggle source
Calls superclass method EaseEngine::Socket#send
# File lib/ease_engine/socket.rb, line 161
def send( msg, flags, *args )
  if args.empty? && ! @dst_addr.nil?
    super( msg, flags, @dst_addr[ 3 ], @dst_addr[ 1 ] )
  else
    super( msg, flags, *args )
  end
end