Permalink
Browse files

Set keepalive/timeout when using TLS, if available.

  • Loading branch information...
dsamarin committed Jun 3, 2012
1 parent 74bac9a commit b1faa71602b34c1b08aa082ed43d2764719a60ca
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/irc/client.js
View
@@ -42,10 +42,10 @@ Client.prototype.connect = function() {
connection = tls.connect (this.port, this.host, {});
} else {
connection = net.createConnection(this.port, this.host);
- connection.setTimeout(this.timeout);
- connection.setKeepAlive(true);
}
+ if (connection.setTimeout) { connection.setTimeout (this.timeout); }
+ if (connection.setKeepAlive) { connection.setKeepAlive (true); }
connection.setEncoding(this.encoding);
for (var i in this.events) {

0 comments on commit b1faa71

Please sign in to comment.