luf*_*ffy 4 network-programming go server go-http
我是 Go 和网络的新手。我知道 net.Listen 和 http.ListenAndServe 都创建了一个服务器。但它们的功能有什么区别呢?
Ull*_*kut 5
基本上,正如文档所述net.Listen:The network must be "tcp", "tcp4", "tcp6", "unix" or "unixpacket".
net.Listen
The network must be "tcp", "tcp4", "tcp6", "unix" or "unixpacket".
同时http.ListenAndServe创建一个 HTTP 服务器。
http.ListenAndServe
归档时间:
7 年,6 月 前
查看次数:
2277 次
最近记录: