[Modify] Replace it

This commit is contained in:
sta 2016-11-04 16:30:16 +09:00
parent bfab126255
commit c8a2bab27a

View File

@ -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);
}