Permalink
Browse files

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

  • Loading branch information...
yaopiaohai
yaopiaohai committed Jan 18, 2013
2 parents b0c74c6 + ab03bbc commit a3a9767dd3b4c3455642e2bd3bd4d9a87ed168d7
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 a3a9767

Please sign in to comment.