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
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
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