Constructs a blocking UDP Socket.
Constructs a blocking IPv4 UDP Socket.
Get underlying socket handle.
Releases the underlying socket handle from the Socket object. Once it is released, you cannot use the Socket object's methods anymore. This also means the Socket destructor will no longer close the socket - it becomes your responsibility.
Get/set socket's blocking flag.
Get the socket's address family.
Property that indicates if this is a valid, alive socket.
Associate a local address with this socket.
Establish a connection. If the socket is blocking, connect waits for the connection to be made. If the socket is nonblocking, connect returns immediately and the connection attempt is still in progress.
Listen for an incoming connection. bind must be called before you can listen. The backlog is a request of how many pending incoming connections are queued until accepted.
Called by accept when a new Socket must be created for a new connection. To use a derived class, override this method and return an instance of your class. The returned Socket's handle must not be set; Socket has a protected constructor this() to use in this situation.
Accept an incoming connection. If the socket is blocking, accept waits for a connection request. Throws SocketAcceptException if unable to accept. See accepting for use with derived classes.
Disables sends and/or receives.
Immediately drop any connections and release socket resources. The Socket object is no longer usable after close. Calling shutdown before close is recommended for connection-oriented sockets.
Remote endpoint Address.
Local endpoint Address.
Send or receive error code. See wouldHaveBlocked, lastSocketError and Socket.getErrorText for obtaining more information about the error.
Send data on the connection. If the socket is blocking and there is no buffer space left, send waits.
Send data to a specific destination Address. If the destination address is not specified, a connection must have been made and that address is used. If the socket is blocking and there is no buffer space left, sendTo waits.
Receive data on the connection. If the socket is blocking, receive waits until there is data to be received.
Receive data and get the remote endpoint Address. If the socket is blocking, receiveFrom waits until there is data to be received.
Get a socket option.
Common case of getting integer and boolean options.
Get the linger option.
Get a timeout (duration) option.
Set a socket option.
Common case for setting integer and boolean options.
Set the linger option.
Sets a timeout (duration) option, i.e. SocketOption.SNDTIMEO or RCVTIMEO. Zero indicates no timeout.
Get a text description of this socket's error status, and clear the socket's error status.
Enables TCP keep-alive with the specified parameters.
Wait for a socket to change status. A wait timeout of core.time.Duration or TimeVal, may be specified; if a timeout is not specified or the TimeVal is null, the maximum timeout is used. The TimeVal timeout has an unspecified value when select returns.
Can be overridden to support other addresses.
Shortcut class for a UDP Socket.