-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
http2Issues or PRs related to the http2 subsystem.Issues or PRs related to the http2 subsystem.
Description
- Version: v12.4.0
- Platform: Linux pcd 5.1.8-arch1-1-ARCH deps: update openssl to 1.0.1j #1 SMP PREEMPT Sun Jun 9 20:28:28 UTC 2019 x86_64 GNU/Linux
- Subsystem: http2
node-v12.4.0-linux-x64/bin/node a.js
let
http2=require('http2'),
server=http2.createServer()
server.listen(8000,'127.0.0.1',()=>{
let client=http2.connect('http://127.0.0.1:8000',()=>{
console.log('listener called')
server.close(()=>{
console.log('close')
})
})
})
Expected: server.close stops the server from accepting new connections.
Result: console.log('close') never get called.
I aware that HTTP/2 works different to HTTP/1.1. And I can and should call session.close() on every active session to stop them from accepting new requests.
server.close seems also wait until there is no active sessions to call the callback function, which is not mentioned in the documentation.
And, to make there is no active sessions, I must first of all stop the server from accepting new connections.
Metadata
Metadata
Assignees
Labels
http2Issues or PRs related to the http2 subsystem.Issues or PRs related to the http2 subsystem.