Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function connect(url, socketOptions, openCallback) {

var noDelay = !!sockopts.noDelay;
var timeout = sockopts.timeout;
var postConnectTimeout = sockopts.postConnectTimeout || 300000
var keepAlive = !!sockopts.keepAlive;
// 0 is default for node
var keepAliveDelay = sockopts.keepAliveDelay || 0;
Expand Down Expand Up @@ -145,9 +146,8 @@ function connect(url, socketOptions, openCallback) {

var c = new Connection(sock);
c.open(fields, function(err, ok) {
// disable timeout once the connection is open, we don't want
// it fouling things
if (timeout) sock.setTimeout(0);
// revert to post-connection timeout (typically requires longer timeouts)
sock.setTimeout(postConnectTimeout);
if (err === null) {
openCallback(null, c);
}
Expand Down