Listen Error
This commit is contained in:
parent
101cce532f
commit
815ec2565b
|
@ -145,15 +145,17 @@ func (e *engine) createPeerTemplate() *PeerApp {
|
||||||
// Listen sets up an onion listener to process incoming cwtch messages
|
// Listen sets up an onion listener to process incoming cwtch messages
|
||||||
func (e *engine) listenFn() {
|
func (e *engine) listenFn() {
|
||||||
err := e.service.Listen(e.createPeerTemplate())
|
err := e.service.Listen(e.createPeerTemplate())
|
||||||
|
if !e.shuttingDown {
|
||||||
e.eventManager.Publish(event.NewEvent(event.ProtocolEngineStopped, map[event.Field]string{event.Identity: e.identity.Hostname(), event.Error: err.Error()}))
|
e.eventManager.Publish(event.NewEvent(event.ProtocolEngineStopped, map[event.Field]string{event.Identity: e.identity.Hostname(), event.Error: err.Error()}))
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown tears down the eventHandler goroutine
|
// Shutdown tears down the eventHandler goroutine
|
||||||
func (e *engine) Shutdown() {
|
func (e *engine) Shutdown() {
|
||||||
e.shuttingDown = true
|
e.shuttingDown = true
|
||||||
e.service.Shutdown()
|
|
||||||
e.connectionsManager.Shutdown()
|
e.connectionsManager.Shutdown()
|
||||||
|
e.service.Shutdown()
|
||||||
e.queue.Shutdown()
|
e.queue.Shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue