fix WebSocket.cs
This commit is contained in:
parent
e9d591b606
commit
6cd3f2ad91
@ -2,7 +2,7 @@
|
|||||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release_Ubuntu" ctype="Workspace" />
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Release_Ubuntu" ctype="Workspace" />
|
||||||
<MonoDevelop.Ide.Workbench ActiveDocument="websocket-sharp/WebSocket.cs" ctype="Workbench">
|
<MonoDevelop.Ide.Workbench ActiveDocument="websocket-sharp/WebSocket.cs" ctype="Workbench">
|
||||||
<Files>
|
<Files>
|
||||||
<File FileName="websocket-sharp/WebSocket.cs" Line="5" Column="54" />
|
<File FileName="websocket-sharp/WebSocket.cs" Line="231" Column="1" />
|
||||||
</Files>
|
</Files>
|
||||||
</MonoDevelop.Ide.Workbench>
|
</MonoDevelop.Ide.Workbench>
|
||||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
@ -219,18 +219,16 @@ namespace WebSocketSharp
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
if (OnError != null)
|
||||||
|
{
|
||||||
|
OnError(this, e.Message);
|
||||||
|
}
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Console.WriteLine("WS: Error @close: {0}", e.Message);
|
Console.WriteLine("WS: Error @close: {0}", e.Message);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(Thread.CurrentThread.IsBackground) &&
|
|
||||||
msgThread != null && msgThread.IsAlive)
|
|
||||||
{
|
|
||||||
msgThread.Join();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wsStream != null)
|
if (wsStream != null)
|
||||||
{
|
{
|
||||||
wsStream.Dispose();
|
wsStream.Dispose();
|
||||||
@ -363,14 +361,11 @@ namespace WebSocketSharp
|
|||||||
#endif
|
#endif
|
||||||
while (readyState == WsState.OPEN)
|
while (readyState == WsState.OPEN)
|
||||||
{
|
{
|
||||||
while (readyState == WsState.OPEN && netStream.DataAvailable)
|
data = receive();
|
||||||
{
|
|
||||||
data = receive();
|
|
||||||
|
|
||||||
if (OnMessage != null && data != null)
|
if (OnMessage != null && data != null)
|
||||||
{
|
{
|
||||||
OnMessage(this, data);
|
OnMessage(this, data);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
@ -433,15 +428,18 @@ namespace WebSocketSharp
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (OnError != null)
|
if (readyState == WsState.OPEN)
|
||||||
{
|
{
|
||||||
OnError(this, e.Message);
|
if (OnError != null)
|
||||||
}
|
{
|
||||||
|
OnError(this, e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
ReadyState = WsState.CLOSED;
|
ReadyState = WsState.CLOSING;
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Console.WriteLine("WS: Error @receive: {0}", e.Message);
|
Console.WriteLine("WS: Error @receive: {0}", e.Message);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user