Wanted to ask how many simultaneous connection requests can a server written this way handle?
Or do I have to use select or spawn threads to ensure that the server can handle simultaneous requests/connections? What I mean to ask is that if Go does something beneath the internal implementation in HandleFunc() to handle concurrent requests? Atleast in C you get to specify in listen() as to how many connections you can handle at a time for a socket.
http.ListenAndServe gives each http request its own goroutine.
If you want a hard limit on the maximum number of active connections, it’s up to you to implement the limit and impose connection timeouts. The convenient ListenAndServe method is probably not suitable for a public Internet site because it doesn’t do any of that.
As far as I can tell ListenAndServe* functions have a 3 minute timeout now and thus not leaking connections anymore. As for the ListenAndServe* methods of http.Server, they have always been usable.