diff --git a/HubConnection.go b/HubConnection.go index 09df6ad..1968043 100644 --- a/HubConnection.go +++ b/HubConnection.go @@ -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() { var fullBuffer string var err error = nil