Go client program generates a lot a sockets in TIME_WAIT state
问题 I have a Go program that generates a lot of HTTP requests from multiple goroutines. after running for a while, the program spits out an error: connect: cannot assign requested address. When checking with netstat , I get a high number (28229) of connections in TIME_WAIT . The high number of TIME_WAIT sockets happens when I the number of goroutines is 3 and is severe enough to cause a crash when it is 5. I run Ubuntu 14.4 under docker and go version 1.7 This is the Go program. package main