Bind to a local address in order to receive packets sent there.
Initialize with the given AddressFamily, without binding to an address.
Called when a socket is writable.
Where to send packets to.
Get connection state.
The send buffers.
Whether the first item from this queue (if any) has been partially sent (and thus can't be canceled).
Called when a socket is readable.
Called when an error occurs on the socket.
Close a connection. If there is queued data waiting to be sent, wait until it is sent before disconnecting. The disconnect handler will be called immediately, even when not all data has been flushed yet.
Append data to the send buffer.
Cancel all queued Data packets with the given priority. Does not cancel any partially-sent Data.
Returns true if any queues have pending data.
Returns true if there are any queued Data which have not yet begun to be sent.
Returns the number of queued Data at the given priority.
Returns the number of queued bytes at the given priority.
Callback for when a connection has been established.
Callback for incoming data. Data will not be received unless this handler is set.
Callback for when a connection was closed.
Callback setter for when all queued data has been sent.
Base class for connection-less socket protocols, i.e. those for which we must use sendto instead of connect/send. These generally correspond to stateless / datagram-based protocols, like UDP. This module's class hierarchy is mostly oriented towards stateful, stream-based protocols; to represent connectionless protocols, this class encapsulates a socket with a fixed destination (sendto) address, and optionally bound to a local address. Currently received packets' address is not exposed.