Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Enable TCP timeout by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Apr 8, 2010
1 parent d923c94 commit cb84cde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/net.js
Expand Up @@ -5,6 +5,7 @@ var dns = require('dns');

var kMinPoolSpace = 128;
var kPoolSize = 40*1024;
var kDefaultTimeout = 60*1000;

var debugLevel = process.env['NODE_DEBUG'] ? 1 : 0;
function debug () {
Expand Down Expand Up @@ -257,6 +258,8 @@ function _doFlush () {
}

function initStream (self) {
timeout.enroll(self, kDefaultTimeout);

self._readWatcher = ioWatchers.alloc();
self._readWatcher.callback = function () {
// If this is the first recv (pool doesn't exist) or we've used up
Expand Down

0 comments on commit cb84cde

Please sign in to comment.