[Modify] Add it
This commit is contained in:
parent
437896fc9c
commit
f8955042f7
@ -810,6 +810,51 @@ namespace WebSocketSharp
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool checkIfAvailable (
|
||||
bool client,
|
||||
bool server,
|
||||
bool connecting,
|
||||
bool open,
|
||||
bool closing,
|
||||
bool closed,
|
||||
out string message
|
||||
)
|
||||
{
|
||||
message = null;
|
||||
|
||||
if (!client && _client) {
|
||||
message = "This operation isn't available in: client";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!server && !_client) {
|
||||
message = "This operation isn't available in: server";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!connecting && _readyState == WebSocketState.Connecting) {
|
||||
message = "This operation isn't available in: connecting";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!open && _readyState == WebSocketState.Open) {
|
||||
message = "This operation isn't available in: open";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!closing && _readyState == WebSocketState.Closing) {
|
||||
message = "This operation isn't available in: closing";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!closed && _readyState == WebSocketState.Closed) {
|
||||
message = "This operation isn't available in: closed";
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool checkReceivedFrame (WebSocketFrame frame, out string message)
|
||||
{
|
||||
message = null;
|
||||
|
Loading…
Reference in New Issue
Block a user