2023年11月1日

验证2个节点udp和tcp可通性

摘要: nc-u表示udp,默认是tcp。-l表示作为server监听。-4表示只能使用IPv4地址。-6表示只能使用IPv6地址(老版本ipv6可能不支持指定地址)。 server:192.168.0.104上开启udp 123端口server发送11 client:连接192.168.0.104上udp 阅读全文

posted @ 2023-11-01 23:11 王景迁 阅读(86) 评论(0) 推荐(0)

http包中的ListenAndServe函数是阻塞式的

摘要: package main import ( "fmt" "net/http" ) func main() { fmt.Println("before listen") http.ListenAndServe(":1000", nil) fmt.Println("after listen") } 执行 阅读全文

posted @ 2023-11-01 21:40 王景迁 阅读(173) 评论(0) 推荐(0)

导航