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.ref()

server.ref() Opposite of unref, calling ref on a previously unrefd server will not let the program exit if it's the only server left (the default behavior). If the server is refd calling ref again will have no effect. Returns server.

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.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_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.isIPv4()

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

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.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.isIPv6()

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