Fix Node event chaining in VirtualConnectionServer to work with latest NPM libraries. Fixes #331.
This commit is contained in:
parent
67fc64309f
commit
7e88903bcc
|
|
@ -105,15 +105,16 @@ class VirtualConnectionsCollection {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const newVirtualConnection = new VirtualConnection(beginWriteCallback)
|
const newVirtualConnection = new VirtualConnection(beginWriteCallback);
|
||||||
.on('end', () => {
|
newVirtualConnection.on('end', () => {
|
||||||
// The virtual connection was closed remotely. Clean up locally.
|
// The virtual connection was closed remotely. Clean up locally.
|
||||||
this._onVirtualConnectionWasClosed(header.connectionIdString);
|
this._onVirtualConnectionWasClosed(header.connectionIdString);
|
||||||
}).on('finish', () => {
|
});
|
||||||
// The virtual connection was closed locally. Clean up locally, and notify the remote that we're done.
|
newVirtualConnection.on('finish', () => {
|
||||||
this._onVirtualConnectionWasClosed(header.connectionIdString);
|
// The virtual connection was closed locally. Clean up locally, and notify the remote that we're done.
|
||||||
this._sendFrame(header.connectionIdBinary, new Buffer(0));
|
this._onVirtualConnectionWasClosed(header.connectionIdString);
|
||||||
});
|
this._sendFrame(header.connectionIdBinary, new Buffer(0));
|
||||||
|
});
|
||||||
|
|
||||||
this._virtualConnections[header.connectionIdString] = newVirtualConnection;
|
this._virtualConnections[header.connectionIdString] = newVirtualConnection;
|
||||||
this._onVirtualConnectionCallback(newVirtualConnection);
|
this._onVirtualConnectionCallback(newVirtualConnection);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue