Permalink
Browse files

Merge "Merge branch '0.3.x' of ssh://pomelo.163.com:29418/pomelo into…

… 0.3.x"
  • Loading branch information...
Charlie Edward Gerrit Code Review
Charlie Edward authored and Gerrit Code Review committed Jan 22, 2013
2 parents 9f156a3 + a3a9767 commit 9a4dd4074ab79c4e0bce4a4994a4f527de75f59f
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/connectors/hybi/wsprocessor.js
@@ -11,10 +11,10 @@ var ST_CLOSED = 2;
*/
var Processor = function() {
EventEmitter.call(this);
this.mockServer = new HttpServer();
this.httpServer = new HttpServer();
var self = this;
this.wsServer = new WebSocketServer({server: this.mockServer});
this.wsServer = new WebSocketServer({server: this.httpServer});
this.wsServer.on('connection', function(socket) {
// emit socket to outside
@@ -31,7 +31,7 @@ Processor.prototype.add = function(socket, data) {
if(this.state !== ST_STARTED) {
return;
}
this.mockServer.emit('connection', socket);
this.httpServer.emit('connection', socket);
socket.emit('data', data);
};
@@ -42,5 +42,5 @@ Processor.prototype.close = function() {
this.state = ST_CLOSED;
this.wsServer.close();
this.wsServer = null;
this.mockServer = null;
this.httpServer = null;
};

0 comments on commit 9a4dd40

Please sign in to comment.