[Modify] Rename it
This commit is contained in:
parent
b5af31a756
commit
d56b9bfef8
@ -719,18 +719,8 @@ namespace WebSocketSharp
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string checkIfAvailable (
|
|
||||||
bool client, bool server, bool connecting, bool open, bool closing, bool closed)
|
|
||||||
{
|
|
||||||
return !client && _client
|
|
||||||
? "This operation isn't available in: client"
|
|
||||||
: !server && !_client
|
|
||||||
? "This operation isn't available in: server"
|
|
||||||
: _readyState.CheckIfAvailable (connecting, open, closing, closed);
|
|
||||||
}
|
|
||||||
|
|
||||||
// As client
|
// As client
|
||||||
private bool checkIfValidHandshakeResponse (HttpResponse response, out string message)
|
private bool checkHandshakeResponse (HttpResponse response, out string message)
|
||||||
{
|
{
|
||||||
message = null;
|
message = null;
|
||||||
|
|
||||||
@ -773,6 +763,16 @@ namespace WebSocketSharp
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string checkIfAvailable (
|
||||||
|
bool client, bool server, bool connecting, bool open, bool closing, bool closed)
|
||||||
|
{
|
||||||
|
return !client && _client
|
||||||
|
? "This operation isn't available in: client"
|
||||||
|
: !server && !_client
|
||||||
|
? "This operation isn't available in: server"
|
||||||
|
: _readyState.CheckIfAvailable (connecting, open, closing, closed);
|
||||||
|
}
|
||||||
|
|
||||||
private bool checkIfValidReceivedFrame (WebSocketFrame frame, out string message)
|
private bool checkIfValidReceivedFrame (WebSocketFrame frame, out string message)
|
||||||
{
|
{
|
||||||
message = null;
|
message = null;
|
||||||
@ -1005,7 +1005,7 @@ namespace WebSocketSharp
|
|||||||
var res = sendHandshakeRequest ();
|
var res = sendHandshakeRequest ();
|
||||||
|
|
||||||
string msg;
|
string msg;
|
||||||
if (!checkIfValidHandshakeResponse (res, out msg))
|
if (!checkHandshakeResponse (res, out msg))
|
||||||
throw new WebSocketException (CloseStatusCode.ProtocolError, msg);
|
throw new WebSocketException (CloseStatusCode.ProtocolError, msg);
|
||||||
|
|
||||||
if (_protocolsRequested)
|
if (_protocolsRequested)
|
||||||
|
Loading…
Reference in New Issue
Block a user