I'm new to Go and Networking. I know both net.Listen and http.ListenAndServe creates a server. But what is the difference between their functionality?
1条回答 默认 最新
- dongwenxiu5200 2018-08-09 08:17关注
Basically, as the documentation says for
net.Listen
:The network must be "tcp", "tcp4", "tcp6", "unix" or "unixpacket".
While
http.ListenAndServe
creates an HTTP server.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报