close the h2quic.RoundTripper in the example client

While it's not necessary, it's best practice to close the RoundTripper.
That way, QUIC can do a proper connection shutdown.
This commit is contained in:
Marten Seemann 2017-12-30 13:45:11 +07:00
parent ad3fbd3a01
commit 3e9c8317db

View file

@ -31,10 +31,12 @@ func main() {
versions = append([]protocol.VersionNumber{protocol.VersionTLS}, versions...)
}
roundTripper := &h2quic.RoundTripper{
QuicConfig: &quic.Config{Versions: versions},
}
defer roundTripper.Close()
hclient := &http.Client{
Transport: &h2quic.RoundTripper{
QuicConfig: &quic.Config{Versions: versions},
},
Transport: roundTripper,
}
var wg sync.WaitGroup