Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: merge http2 Transport dials #13397
Instead of multiplexing streams, concurrent longpoll HTTP2 connections always create new connection, unless it's preceded by a complete roundtrip.
This code will reuse connection
while this code doesn't (as shown by netstat)
complete test is in this gist
This has nothing to do with long polling, and nothing to do with whether RoundTrip completes or not. This is simply the case of the Transport not merging outgoing dials when a connection doesn't exist. There was even a TODO in the code for this already. Fix coming.