Fixed close(PayloadData data) method in websocket-sharp/WebSocket.cs
This commit is contained in:
parent
118e0015d5
commit
a93dcc09aa
@ -226,23 +226,17 @@ namespace WebSocketSharp
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (OnClose != null)
|
||||
{
|
||||
OnClose(this, new CloseEventArgs(data));
|
||||
}
|
||||
|
||||
if (_readyState == WsState.CONNECTING)
|
||||
else if (_readyState == WsState.CONNECTING)
|
||||
{
|
||||
ReadyState = WsState.CLOSED;
|
||||
emitOnClose(data);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ReadyState = WsState.CLOSING;
|
||||
}
|
||||
}
|
||||
|
||||
ReadyState = WsState.CLOSING;
|
||||
}
|
||||
|
||||
emitOnClose(data);
|
||||
var frame = new WsFrame(Opcode.CLOSE, data);
|
||||
closeHandshake(frame);
|
||||
#if DEBUG
|
||||
@ -434,6 +428,14 @@ namespace WebSocketSharp
|
||||
ReadyState = WsState.OPEN;
|
||||
}
|
||||
|
||||
private void emitOnClose(PayloadData data)
|
||||
{
|
||||
if (OnClose != null)
|
||||
{
|
||||
OnClose(this, new CloseEventArgs(data));
|
||||
}
|
||||
}
|
||||
|
||||
private void error(string message)
|
||||
{
|
||||
var callerFrame = new StackFrame(1);
|
||||
|
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