This class is an abstraction of a TCP socket or a streaming [IPC][] endpoint
(uses named pipes on Windows, and UNIX domain sockets otherwise). A
net.Socket
is also a [duplex stream][], so it can be both readable and
writable, and it is also a [EventEmitter
][].
A net.Socket
can be created by the user and used directly to interact with
a server. For example, it is returned by [net.createConnection()
][],
so the user can use it to talk to the server.
It can also be created by Node.js and passed to the user when a connection
is received. For example, it is passed to the listeners of a
['connection'
][] event emitted on a [net.Server
][], so the user can use
it to interact with the client.