|
|
|
|
@ -2689,14 +2689,12 @@ namespace WebSocketSharp
|
|
|
|
|
/// </param>
|
|
|
|
|
public void Send (FileInfo file)
|
|
|
|
|
{
|
|
|
|
|
var msg = _readyState.CheckIfAvailable (false, true, false, false) ??
|
|
|
|
|
CheckSendParameter (file);
|
|
|
|
|
|
|
|
|
|
if (msg != null) {
|
|
|
|
|
_logger.Error (msg);
|
|
|
|
|
error ("An error has occurred in sending data.", null);
|
|
|
|
|
if (file == null)
|
|
|
|
|
throw new ArgumentNullException ("file");
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
if (_readyState != WebSocketState.Open) {
|
|
|
|
|
var msg = "The current state of the connection is not Open.";
|
|
|
|
|
throw new InvalidOperationException (msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
send (Opcode.Binary, file.OpenRead ());
|
|
|
|
|
|