Hacker News new | ask | show | jobs
by toddh 4851 days ago
There are a few bumps and warts. The server close issue was one that made wonder if they ever tested, but I eventually discovered you can close down a server:

lis, err := net.Listen("tcp","127.0.0.1:80")

go http.Serve(lis, router)

lis.Close()

1 comments

Closing the server is easy; making sure all in flight requests finish successfully, not so easy.