[Modify] Add it

This commit is contained in:
sta 2017-02-23 15:18:26 +09:00
parent aa7ff1115e
commit d37e6f6722

View File

@ -125,6 +125,24 @@ namespace WebSocketSharp.Server
#region Private Methods
private bool canSet (out string message)
{
message = null;
var state = _sessions.State;
if (state == ServerState.Start) {
message = "The service has already started.";
return false;
}
if (state == ServerState.ShuttingDown) {
message = "The service is shutting down.";
return false;
}
return true;
}
private Func<TBehavior> createCreator (
Func<TBehavior> creator, Action<TBehavior> initializer
)