From f035e3d6041af78ff9c2281823a415ea7f44bee2 Mon Sep 17 00:00:00 2001 From: SolidNerd Date: Sun, 3 Apr 2016 19:37:21 +0200 Subject: [PATCH] Make it usable in pcl's --- websocket-sharp/Server/WebSocketBehavior.cs | 39 --------------- websocket-sharp/WebSocket.cs | 53 --------------------- 2 files changed, 92 deletions(-) diff --git a/websocket-sharp/Server/WebSocketBehavior.cs b/websocket-sharp/Server/WebSocketBehavior.cs index 71febd7f3..bdec9f27e 100644 --- a/websocket-sharp/Server/WebSocketBehavior.cs +++ b/websocket-sharp/Server/WebSocketBehavior.cs @@ -457,20 +457,6 @@ protected void Send (byte[] data) _websocket.Send (data); } - /// - /// Sends the specified as binary data to the client on a session. - /// - /// - /// This method is available after the WebSocket connection has been established. - /// - /// - /// A that represents the file to send. - /// - protected void Send (FileInfo file) - { - if (_websocket != null) - _websocket.Send (file); - } /// /// Sends text to the client on a session. @@ -512,31 +498,6 @@ protected void SendAsync (byte[] data, Action completed) _websocket.SendAsync (data, completed); } - /// - /// Sends the specified as binary data asynchronously to - /// the client on a session. - /// - /// - /// - /// This method is available after the WebSocket connection has been established. - /// - /// - /// This method doesn't wait for the send to be complete. - /// - /// - /// - /// A that represents the file to send. - /// - /// - /// An Action<bool> delegate that references the method(s) called when - /// the send is complete. A passed to this delegate is true - /// if the send is complete successfully. - /// - protected void SendAsync (FileInfo file, Action completed) - { - if (_websocket != null) - _websocket.SendAsync (file, completed); - } /// /// Sends text asynchronously to the client on a session. diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index b463b4f52..5937bfe03 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -1897,10 +1897,6 @@ internal static string CheckSendParameter (byte[] data) return data == null ? "'data' is null." : null; } - internal static string CheckSendParameter (FileInfo file) - { - return file == null ? "'file' is null." : null; - } internal static string CheckSendParameter (string data) { @@ -2565,26 +2561,6 @@ public void Send (byte[] data) send (Opcode.Binary, new MemoryStream (data)); } - /// - /// Sends the specified as binary data using the WebSocket connection. - /// - /// - /// A that represents the file to send. - /// - 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); - - return; - } - - send (Opcode.Binary, file.OpenRead ()); - } /// /// Sends text using the WebSocket connection. @@ -2636,35 +2612,6 @@ public void SendAsync (byte[] data, Action completed) sendAsync (Opcode.Binary, new MemoryStream (data), completed); } - /// - /// Sends the specified as binary data asynchronously using - /// the WebSocket connection. - /// - /// - /// This method doesn't wait for the send to be complete. - /// - /// - /// A that represents the file to send. - /// - /// - /// An Action<bool> delegate that references the method(s) called when - /// the send is complete. A passed to this delegate is true - /// if the send is complete successfully. - /// - public void SendAsync (FileInfo file, Action completed) - { - 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); - - return; - } - - sendAsync (Opcode.Binary, file.OpenRead (), completed); - } /// /// Sends text asynchronously using the WebSocket connection.