Permalink
Browse files

xmpp.js: Set connection timeout to 0 to disable it (thanks pkrumins)

  • Loading branch information...
mwild1 committed Apr 16, 2010
1 parent cd57154 commit b5b67d5005f62354c53cc9a319d2d764daedad54
Showing with 6 additions and 4 deletions.
  1. +6 −4 xmpp.js
View
10 xmpp.js
@@ -136,10 +136,12 @@ exports.Connection.prototype = {
var conn = this;
- // Note that tcp.createConnection also initiates the connection.
- // This doesn't appear to create problems with adding listeners
- // afterward, but should be kept in mind should any arise.
- this.socket = tcp.createConnection(this.port, this.host)
+ // Note that tcp.createConnection also initiates the connection.
+ // This doesn't appear to create problems with adding listeners
+ // afterward, but should be kept in mind should any arise.
+ this.socket = tcp.createConnection(this.port, this.host)
+
+ this.socket.setTimeout(0); // Because Node's default timeout is 60s
this.socket.addListener("connect", recontext(this, conn._socket_connected));
this.socket.addListener("disconnect", recontext(this, conn._socket_disconnected));

0 comments on commit b5b67d5

Please sign in to comment.