# HG changeset patch # User Matthew Wild # Date 1271455506 -3600 # Node ID 998b0659c5f7878a38e0b7093d13ff69ce7f25c0 # Parent 06abd01c13cbcdbce3a0c1eaefcde54f4a5802d4 xmpp.js: Set connection timeout to 0 to disable it (thanks pkrumins) diff -r 06abd01c13cb -r 998b0659c5f7 xmpp.js --- a/xmpp.js Mon Mar 01 15:52:39 2010 +0000 +++ b/xmpp.js Fri Apr 16 23:05:06 2010 +0100 @@ -136,10 +136,12 @@ 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));