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