diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index d10c4c3c..e1d975f7 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -2773,16 +2773,14 @@ namespace WebSocketSharp /// public void SendAsync (byte[] data, Action completed) { - var msg = _readyState.CheckIfAvailable (false, true, false, false) ?? - CheckSendParameter (data); - - if (msg != null) { - _logger.Error (msg); - error ("An error has occurred in sending data.", null); - - return; + if (_readyState != WebSocketState.Open) { + var msg = "The current state of the connection is not Open."; + throw new InvalidOperationException (msg); } + if (data == null) + throw new ArgumentNullException ("data"); + sendAsync (Opcode.Binary, new MemoryStream (data), completed); }