mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 11:48:09 +08:00
18 lines
246 B
Go
18 lines
246 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/net/gudp"
|
|
)
|
|
|
|
func main() {
|
|
gudp.NewServer("127.0.0.1:8999", func(conn *gudp.Conn) {
|
|
defer conn.Close()
|
|
for {
|
|
data, err := conn.Recv(-1)
|
|
fmt.Println(err, string(data))
|
|
}
|
|
}).Run()
|
|
}
|