Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge "support stream2 in node 0.10.x"

  • Loading branch information...
commit 17f003c2d8fdc6559b30021ffae496cc84243eb2 2 parents 8a7cf28 + fbdbb94
@xiecc xiecc authored Gerrit Code Review committed
View
4 lib/common/service/localSessionService.js
@@ -268,10 +268,6 @@ LocalSession.prototype.export = function() {
return res;
};
-var rpcInvoke = function(app, sid, namespace, service, method, args, cb) {
- app.rpcInvoke(sid, {namespace: namespace, service: service, method: method, args: args}, cb);
-};
-
var localSessionCB = function(service, cb, err, sinfo) {
if(err) {
cb(err);
View
8 lib/connectors/hybrid/wsprocessor.js
@@ -32,7 +32,13 @@ Processor.prototype.add = function(socket, data) {
return;
}
this.httpServer.emit('connection', socket);
- socket.emit('data', data);
+ if(typeof socket.ondata === 'function') {
+ // compatible with stream2
+ socket.ondata(data, 0, data.length);
+ } else {
+ // compatible with old stream
+ socket.emit('data', data);
+ }
};
Processor.prototype.close = function() {
Please sign in to comment.
Something went wrong with that request. Please try again.