From 0bc9929f86d64e67769ca40488ae91edd01ab265 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Fri, 12 Oct 2012 09:00:50 -0700 Subject: [PATCH 1/2] remove greetings --- lib/sockets/sock.js | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/lib/sockets/sock.js b/lib/sockets/sock.js index 016bc40..ec6f6b5 100644 --- a/lib/sockets/sock.js +++ b/lib/sockets/sock.js @@ -37,7 +37,6 @@ function Socket() { this.opts = {}; this.server = null; this.socks = []; - this.map = {}; this.settings = {}; this.format('none'); this.set('identity', String(process.pid)); @@ -143,11 +142,10 @@ Socket.prototype.close = function(){ */ Socket.prototype.address = function(){ - if (this.server) { - var addr = this.server.address(); - addr.string = 'tcp://' + addr.address + ':' + addr.port; - return addr; - } + if (!this.server) return; + var addr = this.server.address(); + addr.string = 'tcp://' + addr.address + ':' + addr.port; + return addr; }; /** @@ -176,22 +174,8 @@ Socket.prototype.addSocket = function(sock){ , parser = new Parser , n = this.socks.push(sock); - // send our greeting - sock.write(this.pack(this.get('identity'))); - - // parse incoming sock.on('data', parser.write.bind(parser)); - - // accept greeting once, emit messages there on out - parser.onmessage = ongreeting; - - function ongreeting(msg){ - var id = String(msg); - if ('0' === id) id = pid + Date.now() + n; - sock._axon_id = id; - self.map[id] = sock; - parser.onmessage = self.onmessage(sock); - } + parser.onmessage = self.onmessage(sock); }; /** From 4ce89a679a65c35ec45686419be8589be6be9495 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Fri, 12 Oct 2012 09:01:45 -0700 Subject: [PATCH 2/2] ocd --- lib/sockets/rep.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sockets/rep.js b/lib/sockets/rep.js index 3d01c47..5e20e25 100644 --- a/lib/sockets/rep.js +++ b/lib/sockets/rep.js @@ -46,7 +46,7 @@ RepSocket.prototype.onmessage = function(sock){ msg.push(reply); self.emit.apply(self, msg); - function reply(){ + function reply() { var args = [].slice.call(arguments); args[0] = args[0] || null; args.push(id);