frp/utils/net/udp_test.go
2017-03-09 22:44:42 +08:00

28 lines
344 B
Go

package net
import (
"fmt"
"testing"
)
func TestA(t *testing.T) {
l, err := ListenUDP("0.0.0.0", 9000)
if err != nil {
fmt.Println(err)
}
for {
c, _ := l.Accept()
go func() {
for {
buf := make([]byte, 1450)
n, err := c.Read(buf)
if err != nil {
fmt.Println(buf[:n])
}
c.Write(buf[:n])
}
}()
}
}