Enhance TCP Fast Open (#310)

This commit is contained in:
risetechlab 2021-03-06 22:45:12 +08:00 committed by GitHub
parent e1a5392beb
commit ad1807dd99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 147 additions and 198 deletions

View file

@ -17,14 +17,14 @@ func TestTCPFastOpen(t *testing.T) {
return b
},
}
dest, err := tcpServer.StartContext(context.Background(), &SocketConfig{Tfo: SocketConfig_Enable})
dest, err := tcpServer.StartContext(context.Background(), &SocketConfig{Tfo: 256})
common.Must(err)
defer tcpServer.Close()
ctx := context.Background()
dialer := DefaultSystemDialer{}
conn, err := dialer.Dial(ctx, nil, dest, &SocketConfig{
Tfo: SocketConfig_Enable,
Tfo: 1,
})
common.Must(err)
defer conn.Close()