Net fixes

This commit is contained in:
Kagami Hiiragi 2015-02-20 19:37:28 +03:00
parent 06df8c42b3
commit 3f57b972d7
2 changed files with 0 additions and 10 deletions

View File

@ -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) {

View File

@ -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) {