Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 7e88903

Browse files
Fix Node event chaining in VirtualConnectionServer to work with latest NPM libraries. Fixes #331.
1 parent 67fc643 commit 7e88903

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/Microsoft.AspNetCore.NodeServices/TypeScript/VirtualConnections/VirtualConnectionServer.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,16 @@ class VirtualConnectionsCollection {
105105
}
106106
};
107107

108-
const newVirtualConnection = new VirtualConnection(beginWriteCallback)
109-
.on('end', () => {
110-
// The virtual connection was closed remotely. Clean up locally.
111-
this._onVirtualConnectionWasClosed(header.connectionIdString);
112-
}).on('finish', () => {
113-
// The virtual connection was closed locally. Clean up locally, and notify the remote that we're done.
114-
this._onVirtualConnectionWasClosed(header.connectionIdString);
115-
this._sendFrame(header.connectionIdBinary, new Buffer(0));
116-
});
108+
const newVirtualConnection = new VirtualConnection(beginWriteCallback);
109+
newVirtualConnection.on('end', () => {
110+
// The virtual connection was closed remotely. Clean up locally.
111+
this._onVirtualConnectionWasClosed(header.connectionIdString);
112+
});
113+
newVirtualConnection.on('finish', () => {
114+
// The virtual connection was closed locally. Clean up locally, and notify the remote that we're done.
115+
this._onVirtualConnectionWasClosed(header.connectionIdString);
116+
this._sendFrame(header.connectionIdBinary, new Buffer(0));
117+
});
117118

118119
this._virtualConnections[header.connectionIdString] = newVirtualConnection;
119120
this._onVirtualConnectionCallback(newVirtualConnection);

0 commit comments

Comments
 (0)