Creates a new socket connection to the host and port and returns a Future
that will complete with either a RawSocket once connected or an error
if the host-lookup or connection failed.
Set or get, if the RawSocket should listen for RawSocketEvent.WRITE
events. Default is true.
This is a one-shot listener, and writeEventsEnabled must be set
to true again to receive another write event.
Read up to len bytes from the socket. This function is
non-blocking and will only return data if data is available. The
number of bytes read can be less then len if fewer bytes are
available for immediate reading. If no data is available null
is returned.
Writes up to count bytes of the buffer from offset buffer offset to
the socket. The number of successfully written bytes is returned. This
function is non-blocking and will only write data if buffer space is
available in the socket.