[Modify] Add it

This commit is contained in:
sta 2021-12-22 19:44:15 +09:00
parent 328e521249
commit 2e146900c6

View File

@ -848,6 +848,42 @@ namespace WebSocketSharp.Server
abort ();
}
private void start ()
{
lock (_sync) {
if (_state == ServerState.Start || _state == ServerState.ShuttingDown)
return;
if (_secure) {
var src = getSslConfiguration ();
var conf = new ServerSslConfiguration (src);
if (conf.ServerCertificate == null) {
var msg = "There is no server certificate for secure connection.";
throw new InvalidOperationException (msg);
}
_sslConfigInUse = conf;
}
_realmInUse = getRealm ();
_services.Start ();
try {
startReceiving ();
}
catch {
_services.Stop (1011, String.Empty);
throw;
}
_state = ServerState.Start;
}
}
private void start (ServerSslConfiguration sslConfig)
{
lock (_sync) {