@@ -841,82 +841,10 @@ added: v0.1.90
841
841
842
842
Stops the server from accepting new connections. See [ ` net.Server.close() ` ] [ ] .
843
843
844
- ### server.listen(handle[ , callback] )
845
- <!-- YAML
846
- added: v0.5.10
847
- -->
848
-
849
- * ` handle ` {Object}
850
- * ` callback ` {Function}
851
-
852
- The ` handle ` object can be set to either a server or socket (anything
853
- with an underlying ` _handle ` member), or a ` {fd: <n>} ` object.
854
-
855
- This will cause the server to accept connections on the specified
856
- handle, but it is presumed that the file descriptor or handle has
857
- already been bound to a port or domain socket.
858
-
859
- Listening on a file descriptor is not supported on Windows.
860
-
861
- This function is asynchronous. ` callback ` will be added as a listener for the
862
- [ ` 'listening' ` ] [ ] event. See also [ ` net.Server.listen() ` ] [ ] .
863
-
864
- Returns ` server ` .
865
-
866
- * Note* : The ` server.listen() ` method may be called multiple times. Each
867
- subsequent call will * re-open* the server using the provided options.
868
-
869
- ### server.listen(path[ , callback] )
870
- <!-- YAML
871
- added: v0.1.90
872
- -->
873
-
874
- * ` path ` {string}
875
- * ` callback ` {Function}
876
-
877
- Start a UNIX socket server listening for connections on the given ` path ` .
878
-
879
- This function is asynchronous. ` callback ` will be added as a listener for the
880
- [ ` 'listening' ` ] [ ] event. See also [ ` net.Server.listen(path) ` ] [ ] .
881
-
882
- * Note* : The ` server.listen() ` method may be called multiple times. Each
883
- subsequent call will * re-open* the server using the provided options.
884
-
885
- ### server.listen([ port] [ , hostname ] [ , backlog] [ , callback ] )
886
- <!-- YAML
887
- added: v0.1.90
888
- -->
889
-
890
- * ` port ` {number}
891
- * ` hostname ` {string}
892
- * ` backlog ` {number}
893
- * ` callback ` {Function}
894
-
895
- Begin accepting connections on the specified ` port ` and ` hostname ` . If the
896
- ` hostname ` is omitted, the server will accept connections on the
897
- [ unspecified IPv6 address] [ ] (` :: ` ) when IPv6 is available, or the
898
- [ unspecified IPv4 address] [ ] (` 0.0.0.0 ` ) otherwise.
899
-
900
- * Note* : In most operating systems, listening to the
901
- [ unspecified IPv6 address] [ ] (` :: ` ) may cause the ` net.Server ` to also listen on
902
- the [ unspecified IPv4 address] [ ] (` 0.0.0.0 ` ).
903
-
904
- Omit the port argument, or use a port value of ` 0 ` , to have the operating system
905
- assign a random port, which can be retrieved by using ` server.address().port `
906
- after the ` 'listening' ` event has been emitted.
907
-
908
- To listen to a unix socket, supply a filename instead of port and hostname.
909
-
910
- ` backlog ` is the maximum length of the queue of pending connections.
911
- The actual length will be determined by the OS through sysctl settings such as
912
- ` tcp_max_syn_backlog ` and ` somaxconn ` on linux. The default value of this
913
- parameter is 511 (not 512).
914
-
915
- This function is asynchronous. ` callback ` will be added as a listener for the
916
- [ ` 'listening' ` ] [ ] event. See also [ ` net.Server.listen(port) ` ] [ ] .
844
+ ### server.listen()
917
845
918
- * Note * : The ` server.listen() ` method may be called multiple times. Each
919
- subsequent call will * re-open * the server using the provided options .
846
+ Starts the HTTP server listening for connections.
847
+ This method is identical to [ ` server.listen() ` ] [ ] from [ ` net.Server ` ] [ ] .
920
848
921
849
### server.listening
922
850
<!-- YAML
@@ -1971,6 +1899,7 @@ const req = http.request(options, (res) => {
1971
1899
[ `response.write(data, encoding)` ] : #http_response_write_chunk_encoding_callback
1972
1900
[ `response.writeContinue()` ] : #http_response_writecontinue
1973
1901
[ `response.writeHead()` ] : #http_response_writehead_statuscode_statusmessage_headers
1902
+ [ `server.listen()` ] : net.html#net_server_listen
1974
1903
[ `server.timeout` ] : #http_server_timeout
1975
1904
[ `setHeader(name, value)` ] : #http_request_setheader_name_value
1976
1905
[ `socket.setKeepAlive()` ] : net.html#net_socket_setkeepalive_enable_initialdelay
0 commit comments