Creates a TCP Server listening on a given port (an optional host) for new TCP Client connections.
The local port the socket will be bound to.
The local address to be bound to (example: "localhost" or "127.0.0.1"). Empty/undefined (by default) or "*" means all variable addresses.
The IP version to be used. IPv4 by default.
Gets the socket local address. Empty string means any bound host.
Gets/sets the blocking nature of the Socket. True if to block, false otherwise.
When a socket is blocking, calls such as receive() and accept() will synchronously wait until there is data to return from those calls. When a socket is not set to block, they will check and immediately return undefined when there is no data from those calls.
Flag if this socket has been manually disconnected and thus destroyed. Destroyed sockets cannot be re-used. True if this socket has been destroyed and disconnected. False otherwise.
NOTE: On unexpected socket errors this may not be set correctly. This check can only ensure this socket disconnected in an expected fashion.
Flag if the socket is Internet Protocol Version 4 (IPv4).
Flag if the socket is Internet Protocol Version 6 (IPv6).
The local port the socket is bound to.
Listens for a new client connection, and accepts them, returning a new
SocketClientTCP
instance as an interface to send and receive
data from their connection.
When a new connection can be accepted, a new
SocketClientTCP
instance. If set to blocking this call will
synchronously block until a connect is made to accept and return.
Otherwise when not blocking and there is no connection to accept,
undefined
is returned.
Disconnects this so. Once this is called the socket is considered "destroyed" and no no longer be used for any form of communication.
Generated using TypeDoc
Represents a TCP Server connection.