Thanks!

That clears up a couple of nagging questions I had.

Joe

On Monday, September 23, 2019 at 7:45:16 PM UTC-7, Ben Burwell wrote:
>
> On Mon Sep 23, 2019 at 5:50 PM joe mcguckin wrote: 
> > In ListenAndServe, I see that it calls (*Server).Serve(ln), then 'go 
> c.serve(ctx)' 
> > I can't find a function named 'serve'. Where is this? 
>
> On line 1760 of the same file, server.go. 
>
> > Does HTTP manage a pool of coroutines or does it create one for every 
> > incoming HTTP request. 
>
> A new goroutine is created to handle each connection from the listener. 
>
> > It's clear where the first request gets handled 
> > but where do subsequent requests get handled? 
>
> Subsequent requests get handled in the same manner. Note that `go 
> c.serve(ctx)` is in a loop which blocks waiting for a new connection 
> (with `l.Accept()`). Once the goroutine has been dispatched to handle 
> the request, the main goroutine returns to waiting for the next request. 
>

-- 
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/f839acf3-c388-480e-b3a0-35da08424037%40googlegroups.com.

Reply via email to