Reputation: 127
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?
Upvotes: 6
Views: 2820
Reputation: 3734
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.
Upvotes: 6