File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,7 @@ server.close();
247
247
* ` host ` {string} Host the client should connect to.
248
248
* ` backlog ` {number} The maximum length of the queue of pending connections. ** Default:** ` 511 ` .
249
249
* ` listenListener ` {Function} Listener for the ` 'listening' ` event.
250
+ * Returns: {Object} The self instance of ` net.Server ` .
250
251
251
252
Begin accepting connections on the specified port and hostname.
252
253
If the hostname is omitted, the server will accept connections on any IPv4 address (0.0.0.0).
Original file line number Diff line number Diff line change @@ -523,6 +523,8 @@ Server.prototype.listen = function() {
523
523
self . emit ( 'listening' ) ;
524
524
}
525
525
} ) ;
526
+
527
+ return this ;
526
528
} ;
527
529
528
530
Original file line number Diff line number Diff line change @@ -25,9 +25,7 @@ var server = net.createServer({
25
25
function ( socket ) {
26
26
server . close ( ) ;
27
27
}
28
- ) ;
29
-
30
- server . listen ( port ) ;
28
+ ) . listen ( port ) ;
31
29
32
30
server . on ( 'connection' , function ( socket ) {
33
31
var data = '' ;
You can’t perform that action at this time.
0 commit comments