forked from quic-go/quic-go
fix incorrect reuse of UDP connection in handshake benchmark (#4491)
This commit is contained in:
@@ -33,10 +33,13 @@ func BenchmarkHandshake(b *testing.B) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
}
|
}
|
||||||
|
defer conn.Close()
|
||||||
|
tr := &quic.Transport{Conn: conn}
|
||||||
|
defer tr.Close()
|
||||||
|
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
c, err := quic.Dial(context.Background(), conn, ln.Addr(), tlsClientConfig, nil)
|
c, err := tr.Dial(context.Background(), ln.Addr(), tlsClientConfig, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user