register and deregister

This commit is contained in:
Asim Aslam
2019-01-24 13:58:56 +00:00
committed by Vasiliy Tolstov
parent 88911744b5
commit 00b9b850c6
2 changed files with 6 additions and 17 deletions

View File

@@ -246,12 +246,18 @@ func (h *httpServer) Start() error {
return errors.New("Server required http.Handler")
}
// register
h.Register()
go http.Serve(ln, handler)
go func() {
ch := <-h.exit
ch <- ln.Close()
// deregister
h.Deregister()
opts.Broker.Disconnect()
}()