Add a Shutdown method to server.

Allow gracefull shutdown of a server.
This commit is contained in:
Miek Gieben 2014-08-18 20:30:10 +01:00
parent eb2d26cb96
commit 6cf24a5637
1 changed files with 6 additions and 0 deletions

View File

@ -287,6 +287,12 @@ func (srv *Server) ActivateAndServe() error {
return &Error{err: "bad listeners"}
}
// Shutdown shuts down a server. When Shutdown returns all currently in progress
// queries have been answered and all started goroutines have been stopped.
func (srv *Server) Shutdown() {
}
// serveTCP starts a TCP listener for the server.
// Each request is handled in a seperate goroutine.
func (srv *Server) serveTCP(l *net.TCPListener) error {