[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 type of the behavior of the service to add. The TBehavior must inherit
/// the <see cref="WebSocketBehavior"/> class. /// the <see cref="WebSocketBehavior"/> class.
/// </typeparam> /// </typeparam>
public void AddWebSocketService<TBehavior> (string path, Func<TBehavior> initializer) public void AddWebSocketService<TBehavior> (
string path, Func<TBehavior> initializer
)
where TBehavior : WebSocketBehavior where TBehavior : WebSocketBehavior
{ {
var msg = path.CheckIfValidServicePath () ?? string msg;
(initializer == null ? "'initializer' is null." : null); if (!checkServicePath (path, out msg)) {
if (msg != null) {
_logger.Error (msg); _logger.Error (msg);
return; return;
} }
if (initializer == null) {
_logger.Error ("'initializer' is null.");
return;
}
_services.Add<TBehavior> (path, initializer); _services.Add<TBehavior> (path, initializer);
} }