net_server.listening

server.listening A Boolean indicating whether or not the server is listening for connections.

net_server.listen()

server.listen(handle[, backlog][, callback]) handle <Object> backlog <Number> callback <Function> The handle object can be set to either a server or socket (anything with an underlying _handle member), or a {fd: <n>} object. This will cause the server to accept connections on the specified handle, but it is presumed that the file descriptor or handle has already been bound to a port or domain socket. Listening on a file descriptor is not supported on Windows.

net_server.getConnections()

server.getConnections(callback) Asynchronously get the number of concurrent connections on the server. Works when sockets were sent to forks. Callback should take two arguments err and count.

net_server.connections

server.connections Stability: 0 - Deprecated: Use server.getConnections() instead. The number of concurrent connections on the server. This becomes null when sending a socket to a child with child_process.fork(). To poll forks and get current number of active connections use asynchronous server.getConnections instead.

net_server.close()

server.close([callback]) Stops the server from accepting new connections and keeps existing connections. This function is asynchronous, the server is finally closed when all connections are ended and the server emits a 'close' event. The optional callback will be called once the 'close' event occurs. Unlike that event, it will be called with an Error as its only argument if the server was not open when it was closed.

net_server.address()

server.address() Returns the bound address, the address family name and port of the server as reported by the operating system. Useful to find which port was assigned when giving getting an OS-assigned address. Returns an object with three properties, e.g. { port: 12346, family: 'IPv4', address: '127.0.0.1' } Example: var server = net.createServer((socket) => { socket.end('goodbye\n'); }).on('error', (err) => { // handle errors here throw err; }); // grab a random port. server.li

net.Socket

Class: net.Socket This object is an abstraction of a TCP or local socket. net.Socket instances implement a duplex Stream interface. They can be created by the user and used as a client (with connect()) or they can be created by Node.js and passed to the user through the 'connection' event of a server.

net.Server

Class: net.Server This class is used to create a TCP or local server. net.Server is an EventEmitter with the following events:

net.isIPv6()

net.isIPv6(input) Returns true if input is a version 6 IP address, otherwise returns false.

net.isIPv4()

net.isIPv4(input) Returns true if input is a version 4 IP address, otherwise returns false.