Represents a connected socket
Attach channel for reading so incoming bytes appears in the attached channel. Only one channel could be attached
Attach channel for writing so bytes written to the attached channel will be transmitted Only one channel could be attached
expect abstract fun close()
Local socket address. Could throw an exception if no address bound yet.
Remote socket address. Could throw an exception if the peer is not yet connected or already disconnected.
Represents a socket lifetime, completes at socket closure
Opens socket input and output channels and returns connection object
Check if the socket is closed
Open a read channel, could be done only once
Open a write channel, could be opened only once