From 61ec2d92dc87c5d3da9cb2ebd5a04f79379d42da Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Tue, 3 Jan 2012 10:36:49 -0800 Subject: [PATCH] Keep track of request that originated socket. --- lib/socket.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/socket.js b/lib/socket.js index 171192c6..bf5743e3 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -24,12 +24,10 @@ function Socket (id, server, transport) { this.upgraded = false; this.readyState = 'opening'; - // keep some event handlers references around for later - this.onClose = this.onClose.bind(this); - this.onError = this.onError.bind(this); - this.onPacket = this.onPacket.bind(this); - + // keep track of request that originated the transport + this.req = transport.req; this.setTransport(transport); + this.onOpen(); } /**