Wraps a TCP stream between 2 network adapters, using a custom handler to signal related events. Many of these objects can be active concurrently in a thread if the event loop is running and the handlers do not block.
(Blocking) Resolves the specified host and resets the peer to this address. Use AsyncDNS for a non-blocking resolver. (only usable before connecting).
Sets the peer to the specified IP address and port. (only usable before connecting).
Removes the connection from the event loop, closing it if necessary, and cleans up the underlying resources.
Receive data from the underlying stream. To be used when TCPEvent.READ is received by the callback handler. IMPORTANT: This must be called until is returns a lower value than the buffer!
Starts the connection by registering the associated callback handler in the underlying OS event loop.
Send data through the underlying stream by moving it into the OS buffer.
Changes the default OS configurations for this underlying TCP Socket.
Returns true if this connection was accepted by an AsyncTCPListener instance.
Returns false if the connection has gone.
Returns the OS-specific structure of the internet address for the local end of the connection.
Disables(true)/enables(false) nagle's algorithm (default:enabled).
Returns the OS-specific structure of the internet address of the remote network adapter
Sets the remote address as an OS-specific structure (only usable before connecting).