From 3ba410bc2e568812532afb27854cef53a7e7f611 Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 31 Aug 2015 17:10:35 +0900 Subject: [PATCH] Added checkIfAvailable (bool, bool, bool, bool, bool, bool) method --- websocket-sharp/WebSocket.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index 1ebbc6eb..4ce4aeb5 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -676,6 +676,16 @@ namespace WebSocketSharp : null; } + private string checkIfAvailable ( + bool client, bool server, bool connecting, bool open, bool closing, bool closed) + { + return !client && _client + ? "This operation isn't available in the client." + : !server && !_client + ? "This operation isn't available in the server." + : _readyState.CheckIfAvailable (connecting, open, closing, closed); + } + private string checkIfCanAccept () { return _client