HubConnection.Disconnect() function (via autoreconnect abuse)

This commit is contained in:
mappu 2016-05-04 19:17:20 +12:00
parent 43db3a0d64
commit 3c4972d930

View File

@ -195,6 +195,14 @@ func (this *HubConnection) processProtocolMessage(message string) {
} }
} }
func (this *HubConnection) Disconnect() {
this.autoReconnect = false
if this.conn != nil {
this.conn.Close()
}
// A CONNECTIONSTATE_DISCONNECTED message will be emitted by the worker.
}
func (this *HubConnection) worker() { func (this *HubConnection) worker() {
var fullBuffer string var fullBuffer string
var err error = nil var err error = nil