Stream package:websockets
Lightweight abstraction over an input/output stream.
Lightweight abstraction over an input/output stream.
Build a
Connection from a pre-established stream with already
finished handshake.
NB: this will not perform any handshaking.
Create a stream from a "receive" and "send" action. The following
properties apply:
- Regardless of the provided "receive" and "send" functions, reading
and writing from the stream will be thread-safe, i.e. this function
will create a receive and write lock to be used internally.
- Reading from or writing to a closed Stream will always
throw an exception, even if the underlying "receive" and "send"
functions do not (we do the bookkeeping).
- Streams should always be closed.