From 99e4ebb8424854f52eef6ccfef797539b78f5379 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 3 Apr 2016 18:38:06 +1200 Subject: [PATCH] libnmdc: set our own state before emitting statechange event --- src/libnmdc/libnmdc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnmdc/libnmdc.go b/src/libnmdc/libnmdc.go index 5b28f5f..1c9d442 100644 --- a/src/libnmdc/libnmdc.go +++ b/src/libnmdc/libnmdc.go @@ -366,10 +366,10 @@ func (this *HubConnection) worker() { // Maybe we disconnected if err != nil { - this.OnEvent <- HubEvent{EventType: EVENT_CONNECTION_STATE_CHANGED, StateChange: CONNECTIONSTATE_DISCONNECTED, Message: err.Error()} this.State = CONNECTIONSTATE_DISCONNECTED this.conn = nil this.connValid = false + this.OnEvent <- HubEvent{EventType: EVENT_CONNECTION_STATE_CHANGED, StateChange: CONNECTIONSTATE_DISCONNECTED, Message: err.Error()} time.Sleep(30 * time.Second) // Wait before reconnect continue