Browse Source

Decrease default TCP backlog to 128

...after seeing http://lionet.livejournal.com/42016.html
v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
55a2e8271e
  1. 6
      doc/api.html
  2. 4
      doc/api.txt
  3. 4
      doc/node.1
  4. 2
      src/net.cc

6
doc/api.html

@ -1528,7 +1528,7 @@ Creates a new TCP server.
the <tt>"connection"</tt> event.</p></div> the <tt>"connection"</tt> event.</p></div>
</dd> </dd>
<dt class="hdlist1"> <dt class="hdlist1">
<tt>server.listen(port, host=null, backlog=1024)</tt> <tt>server.listen(port, host=null, backlog=128)</tt>
</dt> </dt>
<dd> <dd>
<p> <p>
@ -1536,7 +1536,7 @@ Tells the server to listen for TCP connections to <tt>port</tt> and <tt>host</tt
</p> </p>
<div class="paragraph"><p><tt>host</tt> is optional. If <tt>host</tt> is not specified the server will accept client <div class="paragraph"><p><tt>host</tt> is optional. If <tt>host</tt> is not specified the server will accept client
connections on any network address.</p></div> connections on any network address.</p></div>
<div class="paragraph"><p>The third argument, <tt>backlog</tt>, is also optional and defaults to 1024. The <div class="paragraph"><p>The third argument, <tt>backlog</tt>, is also optional and defaults to 128. The
<tt>backlog</tt> argument defines the maximum length to which the queue of pending <tt>backlog</tt> argument defines the maximum length to which the queue of pending
connections for the server may grow.</p></div> connections for the server may grow.</p></div>
<div class="paragraph"><p>This function is synchronous.</p></div> <div class="paragraph"><p>This function is synchronous.</p></div>
@ -1944,7 +1944,7 @@ init (Handle&lt;Object&gt; target)
<div id="footer"> <div id="footer">
<div id="footer-text"> <div id="footer-text">
Version 0.1.11<br /> Version 0.1.11<br />
Last updated 2009-09-23 16:59:33 CEST Last updated 2009-09-23 17:54:21 CEST
</div> </div>
</div> </div>
</body> </body>

4
doc/api.txt

@ -985,13 +985,13 @@ The +connection_listener+ argument is automatically set as a listener for
the +"connection"+ event. the +"connection"+ event.
+server.listen(port, host=null, backlog=1024)+ :: +server.listen(port, host=null, backlog=128)+ ::
Tells the server to listen for TCP connections to +port+ and +host+. Tells the server to listen for TCP connections to +port+ and +host+.
+ +
+host+ is optional. If +host+ is not specified the server will accept client +host+ is optional. If +host+ is not specified the server will accept client
connections on any network address. connections on any network address.
+ +
The third argument, +backlog+, is also optional and defaults to 1024. The The third argument, +backlog+, is also optional and defaults to 128. The
+backlog+ argument defines the maximum length to which the queue of pending +backlog+ argument defines the maximum length to which the queue of pending
connections for the server may grow. connections for the server may grow.
+ +

4
doc/node.1

@ -1443,7 +1443,7 @@ argument is automatically set as a listener for the
event\. event\.
.RE .RE
.PP .PP
server\.listen(port, host=null, backlog=1024) server\.listen(port, host=null, backlog=128)
.RS 4 .RS 4
Tells the server to listen for TCP connections to Tells the server to listen for TCP connections to
port port
@ -1456,7 +1456,7 @@ host
is not specified the server will accept client connections on any network address\. is not specified the server will accept client connections on any network address\.
.sp .sp
The third argument, The third argument,
backlog, is also optional and defaults to 1024\. The backlog, is also optional and defaults to 128\. The
backlog backlog
argument defines the maximum length to which the queue of pending connections for the server may grow\. argument defines the maximum length to which the queue of pending connections for the server may grow\.
.sp .sp

2
src/net.cc

@ -521,7 +521,7 @@ Handle<Value> Server::Listen(const Arguments& args) {
#endif #endif
char host[DNS_MAXNAME+1] = "\0"; char host[DNS_MAXNAME+1] = "\0";
int backlog = 1024; int backlog = 128;
if (args.Length() == 2) { if (args.Length() == 2) {
if (args[1]->IsInt32()) { if (args[1]->IsInt32()) {

Loading…
Cancel
Save