Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

Commit

Permalink
Add exception handling back in
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmurphy01 committed Aug 21, 2017
1 parent ec07d5a commit 897d6f3
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Pusher.Connections.Net/WebSocketConnection.cs
Expand Up @@ -92,20 +92,24 @@ public void Close()

public async Task Open()
{
if (_connectionState == ConnectionState.Connected)
try
{
Close();
SetupSocket();
}
if (_connectionState == ConnectionState.Connected)
{
Close();
SetupSocket();
}

_connectionState = ConnectionState.Connecting;
_socket.Open();
_connectionState = ConnectionState.Connecting;
_socket.Open();

_connectionState = ConnectionState.Connected;
if (OnOpen != null)
{
OnOpen(this, new EventArgs());
_connectionState = ConnectionState.Connected;
if (OnOpen != null)
{
OnOpen(this, new EventArgs());
}
}
catch { }
}

public async Task SendMessage(string data)
Expand Down

0 comments on commit 897d6f3

Please sign in to comment.