Class: Async::IO::UDPSocket
- Inherits:
 - 
      IPSocket
      
        
- Object
 - Wrapper
 - Generic
 - BasicSocket
 - IPSocket
 - Async::IO::UDPSocket
 
 
- Defined in:
 - lib/async/io/udp_socket.rb
 
Overview
Asynchronous UDP socket wrapper.
Constant Summary
Constants inherited from Generic
Instance Attribute Summary
Attributes inherited from Generic
Instance Method Summary collapse
- 
  
    
      #initialize(family)  ⇒ UDPSocket 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of UDPSocket.
 - 
  
    
      #recvfrom  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
This function is so fucked.
 
Methods included from Peer
#connected?, #eof, #eof?, #protocol, #sync, #sync=, #type
Methods inherited from Generic
#<<, #connected?, #dup, #nonblock, #nonblock=, #nonblock?, #read, #readable?, #sysread, #syswrite, #wait, wrap, wrap_blocking_method, wraps, #write
Constructor Details
#initialize(family) ⇒ UDPSocket
Returns a new instance of UDPSocket.
      14 15 16 17 18 19 20  | 
    
      # File 'lib/async/io/udp_socket.rb', line 14 def initialize(family) if family.is_a? ::UDPSocket super(family) else super(::UDPSocket.new(family)) end end  | 
  
Instance Method Details
#recvfrom ⇒ Object
This function is so fucked. Why does ‘UDPSocket#recvfrom` return the remote address as an array, but `Socket#recfrom` return it as an `Addrinfo`? You should prefer `recvmsg`. Invokes `recvfrom_nonblock` on the underlying io. If the operation would block, the current task is paused until the operation can succeed, at which point it’s resumed and the operation is completed.
      26  | 
    
      # File 'lib/async/io/udp_socket.rb', line 26 wrap_blocking_method :recvfrom, :recvfrom_nonblock  |