mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 08:22:26 +08:00
添加 github.com/pion/dtls 代码
This commit is contained in:
29
dtls-2.0.9/nettest_test.go
Normal file
29
dtls-2.0.9/nettest_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// +build !js
|
||||
|
||||
package dtls
|
||||
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/pion/transport/test"
|
||||
"golang.org/x/net/nettest"
|
||||
)
|
||||
|
||||
func TestNetTest(t *testing.T) {
|
||||
lim := test.TimeOut(time.Minute*1 + time.Second*10)
|
||||
defer lim.Stop()
|
||||
|
||||
nettest.TestConn(t, func() (c1, c2 net.Conn, stop func(), err error) {
|
||||
c1, c2, err = pipeMemory()
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
stop = func() {
|
||||
_ = c1.Close()
|
||||
_ = c2.Close()
|
||||
}
|
||||
return
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user