The Socket class represents a TCP connection, from which you can
read and write data. A socket begins in a connected state (if the
socket fails to connect, an error is thrown). While in a connected
state, the socket’s ReadableStream and WritableStream can be
read from and written to respectively.
The
Socketclass represents a TCP connection, from which you can read and write data. A socket begins in a connected state (if the socket fails to connect, an error is thrown). While in a connected state, the socket’sReadableStreamandWritableStreamcan be read from and written to respectively.