[go-nuts] Re: net/http Server Shutdown does not free up the port upon return

2017-12-09 Thread asaaveri
Sockets have something called SO_REUSEADDR. BSD libraries, Java and other support this. I would think Go supports this in some form. On Tuesday, November 28, 2017 at 9:53:48 PM UTC-7, Albert Tedja wrote: > > net/http's Shutdown() does not free up the port upon return, or rather it > seems a bi

[go-nuts] Re: net/http Server Shutdown does not free up the port upon return

2017-12-08 Thread Amnon Baron Cohen
netstat is your friend On Wednesday, 29 November 2017 04:53:48 UTC, Albert Tedja wrote: > > net/http's Shutdown() does not free up the port upon return, or rather it > seems a bit undefined how long it takes for the port to be reusable again. > > server := &http.Server{ > Addr: fmt.Sp

[go-nuts] Re: net/http Server Shutdown does not free up the port upon return

2017-11-30 Thread Karan Chaudhary
I think, this is what is happening. I don't think this is a bug. When server shuts down, it asks the kernel to release the resources it was holding. One of the resources is port. Though the program closed the port (by the shutdown()), but kernel still keeps it in TIME_WAIT state. Now if w