Fix for issue #34
This commit is contained in:
parent
6909489f4c
commit
e661827d09
@ -501,11 +501,13 @@ namespace WebSocketSharp
|
|||||||
private bool acceptDataFrame (WsFrame frame)
|
private bool acceptDataFrame (WsFrame frame)
|
||||||
{
|
{
|
||||||
var args = frame.IsCompressed
|
var args = frame.IsCompressed
|
||||||
? new MessageEventArgs (
|
? new MessageEventArgs (
|
||||||
frame.Opcode, frame.PayloadData.ApplicationData.Decompress (_compression))
|
frame.Opcode, frame.PayloadData.ApplicationData.Decompress (_compression))
|
||||||
: new MessageEventArgs (frame.Opcode, frame.PayloadData);
|
: new MessageEventArgs (frame.Opcode, frame.PayloadData);
|
||||||
|
|
||||||
|
if (_readyState == WebSocketState.Open)
|
||||||
|
OnMessage.Emit (this, args);
|
||||||
|
|
||||||
OnMessage.Emit (this, args);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -558,7 +560,9 @@ namespace WebSocketSharp
|
|||||||
data = concatenated.ToArray ();
|
data = concatenated.ToArray ();
|
||||||
}
|
}
|
||||||
|
|
||||||
OnMessage.Emit (this, new MessageEventArgs (first.Opcode, data));
|
if (_readyState == WebSocketState.Open)
|
||||||
|
OnMessage.Emit (this, new MessageEventArgs (first.Opcode, data));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user