|
@ -1665,25 +1665,24 @@ sent to the server on that socket. |
|
|
If a client connection emits an 'error' event - it will forwarded here. |
|
|
If a client connection emits an 'error' event - it will forwarded here. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### server.listen(port, hostname) |
|
|
### server.listen(port, hostname=null, callback=null) |
|
|
|
|
|
|
|
|
Begin accepting connections on the specified port and hostname. If the |
|
|
Begin accepting connections on the specified port and hostname. If the |
|
|
hostname is omitted, the server will accept connections directed to any |
|
|
hostname is omitted, the server will accept connections directed to any |
|
|
address. |
|
|
IPv4 address (`INADDR_ANY`). |
|
|
|
|
|
|
|
|
To listen to a unix socket, supply a filename instead of port and hostname. |
|
|
To listen to a unix socket, supply a filename instead of port and hostname. |
|
|
|
|
|
|
|
|
**If you give a port number as a string, the system will interpret it as a filename in the current directory and create a unix socket.** |
|
|
This function is asynchronous. The last parameter `callback` will be called |
|
|
|
|
|
when the server has been bound to the port. |
|
|
|
|
|
|
|
|
This function is asynchronous. `listening` will be emitted when the server |
|
|
|
|
|
is ready to accept connections. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### server.listen(path, callback=null) |
|
|
### server.listen(path) |
|
|
|
|
|
|
|
|
|
|
|
Start a UNIX socket server listening for connections on the given `path`. |
|
|
Start a UNIX socket server listening for connections on the given `path`. |
|
|
This function is asynchronous. `listening` will be emitted when the server |
|
|
|
|
|
is ready to accept connections. |
|
|
This function is asynchronous. The last parameter `callback` will be called |
|
|
|
|
|
when the server has been bound. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### server.setSecure(credentials) |
|
|
### server.setSecure(credentials) |
|
@ -2077,13 +2076,6 @@ changed to |
|
|
|
|
|
|
|
|
This is an EventEmitter with the following events: |
|
|
This is an EventEmitter with the following events: |
|
|
|
|
|
|
|
|
### Event: 'listening' |
|
|
|
|
|
|
|
|
|
|
|
`function () {}` |
|
|
|
|
|
|
|
|
|
|
|
After `listen()` is called, this event will notify that the server is ready |
|
|
|
|
|
to accept connections. |
|
|
|
|
|
|
|
|
|
|
|
### Event: 'connection' |
|
|
### Event: 'connection' |
|
|
|
|
|
|
|
|
`function (stream) {}` |
|
|
`function (stream) {}` |
|
@ -2104,15 +2096,23 @@ Creates a new TCP server. The `connection_listener` argument is |
|
|
automatically set as a listener for the `'connection'` event. |
|
|
automatically set as a listener for the `'connection'` event. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### server.listen(port, host=null) |
|
|
### server.listen(port, host=null, callback=null) |
|
|
|
|
|
|
|
|
Tells the server to listen for TCP connections to `port` and `host`. |
|
|
Begin accepting connections on the specified `port` and `host`. If the |
|
|
|
|
|
`host` is omitted, the server will accept connections directed to any |
|
|
|
|
|
IPv4 address (`INADDR_ANY`). |
|
|
|
|
|
|
|
|
|
|
|
This function is asynchronous. The last parameter `callback` will be called |
|
|
|
|
|
when the server has been bound. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### server.listen(path, callback=null) |
|
|
|
|
|
|
|
|
|
|
|
Start a UNIX socket server listening for connections on the given `path`. |
|
|
|
|
|
|
|
|
`host` is optional. If `host` is not specified the server will accept client |
|
|
This function is asynchronous. The last parameter `callback` will be called |
|
|
connections on any network address. |
|
|
when the server has been bound. |
|
|
|
|
|
|
|
|
This function is asynchronous. The server will emit `'listening'` when it is |
|
|
|
|
|
safe to connect to it. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### server.close() |
|
|
### server.close() |
|
|