I no longer think it's necessary to call _connection.Disconnect(); because _connection will never be not null, and the only way it can be null is if Disconnect() has been explicitly called.
Also no longer call UnregisterEventsOnConnection(); in Connect(), again because in order to make it that far into the function, Disconnect() must have already been called (which already calls this).
Rebased: https://github.com/pusher-community/pusher-websocket-dotnet/pull/27
I no longer think it's necessary to call
_connection.Disconnect();
because_connection
will never be not null, and the only way it can be null is ifDisconnect()
has been explicitly called.Also no longer call
UnregisterEventsOnConnection();
inConnect()
, again because in order to make it that far into the function,Disconnect()
must have already been called (which already calls this).