[Modify] Throw exception
This commit is contained in:
parent
669f923c96
commit
0e9da7ac58
@ -289,15 +289,11 @@ namespace WebSocketSharp.Server
|
||||
|
||||
lock (_sync) {
|
||||
WebSocketServiceHost host;
|
||||
if (_hosts.TryGetValue (path, out host)) {
|
||||
_logger.Error (
|
||||
"A WebSocket service with the specified path has already existed."
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
if (_hosts.TryGetValue (path, out host))
|
||||
throw new ArgumentException ("Already in use.", "path");
|
||||
|
||||
host = new WebSocketServiceHost<TBehavior> (path, initializer, _logger);
|
||||
|
||||
if (!_clean)
|
||||
host.KeepClean = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user