[Modify] Polish it
This commit is contained in:
parent
78cc325f97
commit
457a60b6cd
@ -349,16 +349,21 @@ namespace WebSocketSharp.Server
|
||||
set {
|
||||
if (ConnectionState != WebSocketState.Connecting) {
|
||||
var msg = "The session has already started.";
|
||||
|
||||
throw new InvalidOperationException (msg);
|
||||
}
|
||||
|
||||
if (value == null || value.Length == 0) {
|
||||
_protocol = null;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!value.IsToken ())
|
||||
throw new ArgumentException ("Not a token.", "value");
|
||||
if (!value.IsToken ()) {
|
||||
var msg = "It is not a token.";
|
||||
|
||||
throw new ArgumentException (msg, "value");
|
||||
}
|
||||
|
||||
_protocol = value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user