On Tuesday, 30 March 2021 at 11:50:07 UTC+1 cpu...@gmail.com wrote: > On Monday, March 29, 2021 at 9:05:50 PM UTC+2 rog wrote: > >> I often call net.Listen directly before calling Serve in a goroutine. >> That way you can connect to the server's socket immediately even though the >> server might take a while to get around to serving the request. >> > > It seems this would work as long as the server is not using HTTPS and > needs to perform a handshake first? >
It makes no difference. The sequence is Listen -> Accept -> start communicating. From the point of view of the socket, the communication is just application data; it may or may not contain a TLS handshake. As long as the socket is in listening state, it will start to queue up incoming connections, up to a kernel limit. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/f98d207e-28a2-447d-9667-87bacbc4b471n%40googlegroups.com.