#163 register services if they are expired

This commit is contained in:
smallnest
2017-10-27 17:30:34 +08:00
parent 1686dca88a
commit 6e35de033e
5 changed files with 67 additions and 10 deletions

View File

@@ -125,8 +125,6 @@ func (s *Server) Serve(network, address string) (err error) {
// creating a new service goroutine for each.
// The service goroutines read requests and then call services to reply to them.
func (s *Server) serveListener(ln net.Listener) error {
s.ln = ln
if s.Plugins == nil {
s.Plugins = &pluginContainer{}
}
@@ -134,6 +132,7 @@ func (s *Server) serveListener(ln net.Listener) error {
var tempDelay time.Duration
s.mu.Lock()
s.ln = ln
if s.activeConn == nil {
s.activeConn = make(map[net.Conn]struct{})
}