[Modify] Replace it
This commit is contained in:
parent
bfab126255
commit
c8a2bab27a
@ -887,17 +887,22 @@ namespace WebSocketSharp.Server
|
||||
/// The type of the behavior of the service to add. The TBehavior must inherit
|
||||
/// the <see cref="WebSocketBehavior"/> class.
|
||||
/// </typeparam>
|
||||
public void AddWebSocketService<TBehavior> (string path, Func<TBehavior> initializer)
|
||||
public void AddWebSocketService<TBehavior> (
|
||||
string path, Func<TBehavior> initializer
|
||||
)
|
||||
where TBehavior : WebSocketBehavior
|
||||
{
|
||||
var msg = path.CheckIfValidServicePath () ??
|
||||
(initializer == null ? "'initializer' is null." : null);
|
||||
|
||||
if (msg != null) {
|
||||
string msg;
|
||||
if (!checkServicePath (path, out msg)) {
|
||||
_logger.Error (msg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (initializer == null) {
|
||||
_logger.Error ("'initializer' is null.");
|
||||
return;
|
||||
}
|
||||
|
||||
_services.Add<TBehavior> (path, initializer);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user