Skip to content

Commit a524d15

Browse files
authored
Merge pull request #2861 from murgatroid99/grpc-js_handle_socket_close
grpc-js: Restore socket disconnect handling
2 parents f0c58f7 + 848e00e commit a524d15

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/grpc-js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grpc/grpc-js",
3-
"version": "1.12.2",
3+
"version": "1.12.3",
44
"description": "gRPC Library for Node - pure JS implementation",
55
"homepage": "https://grpc.io/",
66
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",

packages/grpc-js/src/transport.ts

+5
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ class Http2Transport implements Transport {
227227
this.handleDisconnect();
228228
});
229229

230+
session.socket.once('close', () => {
231+
this.trace('connection closed');
232+
this.handleDisconnect();
233+
});
234+
230235
if (logging.isTracerEnabled(TRACER_NAME)) {
231236
session.on('remoteSettings', (settings: http2.Settings) => {
232237
this.trace(

0 commit comments

Comments
 (0)