[Modify] Throw exceptions
This commit is contained in:
		@@ -2664,14 +2664,12 @@ namespace WebSocketSharp
 | 
			
		||||
    /// </param>
 | 
			
		||||
    public void Send (byte[] data)
 | 
			
		||||
    {
 | 
			
		||||
      var msg = _readyState.CheckIfAvailable (false, true, false, false) ??
 | 
			
		||||
                CheckSendParameter (data);
 | 
			
		||||
      if (data == null)
 | 
			
		||||
        throw new ArgumentNullException ("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);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      send (Opcode.Binary, new MemoryStream (data));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user