From 3f57b972d7bcd379914ce4391c65f989512f9d3e Mon Sep 17 00:00:00 2001 From: Kagami Hiiragi Date: Fri, 20 Feb 2015 19:37:28 +0300 Subject: [PATCH] Net fixes --- lib/net/tcp.js | 5 ----- lib/net/ws.js | 5 ----- 2 files changed, 10 deletions(-) diff --git a/lib/net/tcp.js b/lib/net/tcp.js index d778de3..eee1b84 100644 --- a/lib/net/tcp.js +++ b/lib/net/tcp.js @@ -267,8 +267,6 @@ TcpTransport.prototype.listen = function() { var clientIdCounter = 0; - // TODO(Kagami): Limit number of connected clients (220/192 per - // PyBitmessage). server.on("connection", function(client) { var id = client.id = clientIdCounter++; self._clients[id] = client; @@ -281,9 +279,6 @@ TcpTransport.prototype.listen = function() { var addr = client.remoteAddress; var port = client.remotePort; self.emit("connection", transport, unmap(addr), port); - // Emit "open" manually because "connect" for this socket won't be - // fired. - transport.emit("open"); }); server.on("error", function(err) { diff --git a/lib/net/ws.js b/lib/net/ws.js index 54ac003..49c5655 100644 --- a/lib/net/ws.js +++ b/lib/net/ws.js @@ -185,8 +185,6 @@ WsTransport.prototype.listen = function(options, callback) { var self = this; var server = self._server = new WebSocketServer(options, callback); - // TODO(Kagami): Limit number of connected clients (220/192 per - // PyBitmessage). server.on("connection", function(client) { var transport = new self.constructor(self); var incoming = true; @@ -195,9 +193,6 @@ WsTransport.prototype.listen = function(options, callback) { var addr = client._socket.remoteAddress; var port = client._socket.remotePort; self.emit("connection", transport, unmap(addr), port); - // Emit "open" manually because it won't be fired for already opened - // socket. - transport.emit("open"); }); server.on("error", function(err) {