libnmdc: include error messages with EVENT_CONNECTION_STATE_CHANGED

This commit is contained in:
mappu 2016-04-02 13:49:49 +13:00
parent 433c1ddac9
commit c532e2fe4f

View File

@ -343,7 +343,7 @@ func (this *HubConnection) worker() {
// Maybe we disconnected // Maybe we disconnected
if err != nil { if err != nil {
this.OnEvent <- HubEvent{EventType: EVENT_CONNECTION_STATE_CHANGED, StateChange: CONNECTIONSTATE_DISCONNECTED} this.OnEvent <- HubEvent{EventType: EVENT_CONNECTION_STATE_CHANGED, StateChange: CONNECTIONSTATE_DISCONNECTED, Message: err.Error()}
this.conn = nil this.conn = nil
time.Sleep(30 * time.Second) // Wait before reconnect time.Sleep(30 * time.Second) // Wait before reconnect
continue continue