mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -05:00
fix kcp test
This commit is contained in:
parent
c368412728
commit
9fdb783729
@ -17,7 +17,7 @@ import (
|
|||||||
func TestDialAndListen(t *testing.T) {
|
func TestDialAndListen(t *testing.T) {
|
||||||
assert := With(t)
|
assert := With(t)
|
||||||
|
|
||||||
listerner, err := NewListener(internet.ContextWithTransportSettings(context.Background(), &Config{}), net.LocalHostIP, net.Port(0), func(ctx context.Context, conn internet.Connection) bool {
|
listerner, err := NewListener(internet.ContextWithTransportSettings(context.Background(), &Config{}), net.LocalHostIP, net.Port(0), func(conn internet.Connection) {
|
||||||
go func(c internet.Connection) {
|
go func(c internet.Connection) {
|
||||||
payload := make([]byte, 4096)
|
payload := make([]byte, 4096)
|
||||||
for {
|
for {
|
||||||
@ -32,7 +32,6 @@ func TestDialAndListen(t *testing.T) {
|
|||||||
}
|
}
|
||||||
c.Close()
|
c.Close()
|
||||||
}(conn)
|
}(conn)
|
||||||
return true
|
|
||||||
})
|
})
|
||||||
assert(err, IsNil)
|
assert(err, IsNil)
|
||||||
port := net.Port(listerner.Addr().(*net.UDPAddr).Port)
|
port := net.Port(listerner.Addr().(*net.UDPAddr).Port)
|
||||||
|
Loading…
Reference in New Issue
Block a user