Skip to content

Commit 5f5053a

Browse files
committed
[Modify] Add it
1 parent be5df86 commit 5f5053a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

websocket-sharp/Server/HttpServer.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,35 @@ private void abort ()
615615
_state = ServerState.Stop;
616616
}
617617

618+
private bool checkIfAvailable (
619+
bool ready, bool start, bool shutting, bool stop, out string message
620+
)
621+
{
622+
message = null;
623+
624+
if (!ready && _state == ServerState.Ready) {
625+
message = "This operation is not available in: ready";
626+
return false;
627+
}
628+
629+
if (!start && _state == ServerState.Start) {
630+
message = "This operation is not available in: start";
631+
return false;
632+
}
633+
634+
if (!shutting && _state == ServerState.ShuttingDown) {
635+
message = "This operation is not available in: shutting down";
636+
return false;
637+
}
638+
639+
if (!stop && _state == ServerState.Stop) {
640+
message = "This operation is not available in: stop";
641+
return false;
642+
}
643+
644+
return true;
645+
}
646+
618647
private string checkIfCertificateExists ()
619648
{
620649
if (!_secure)

0 commit comments

Comments
 (0)