Fix issue with keep alive caused by nil channel

This commit is contained in:
Gary Talent 2017-01-28 00:04:04 -06:00
parent 5dd596d755
commit 2b06810bd7

View File

@ -35,7 +35,7 @@ type ServerManager struct {
name string name string
ports []int ports []int
in chan serverManagerEvent in chan serverManagerEvent
done chan interface{} done chan int
connStatus chan ConnStatus connStatus chan ConnStatus
lastKeepAliveTime time.Time lastKeepAliveTime time.Time
server ServerHandler server ServerHandler
@ -47,7 +47,8 @@ func NewServerManager(name string, server ServerHandler, settings Settings) *Ser
sm.name = name sm.name = name
sm.ports = settings.Servers[name].Ports sm.ports = settings.Servers[name].Ports
sm.in = make(chan serverManagerEvent) sm.in = make(chan serverManagerEvent)
sm.done = make(chan interface{}) sm.done = make(chan int)
sm.connStatus = make(chan ConnStatus)
sm.server = server sm.server = server
sm.lastKeepAliveTime = time.Now() sm.lastKeepAliveTime = time.Now()
@ -82,7 +83,7 @@ func (me *ServerManager) Serve() {
ticker.Stop() ticker.Stop()
// notify done // notify done
me.done <- 42 me.done <- 0
} }
/* /*