From 669f923c96a5baf30534c0acd11d693794a59bcc Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 8 Mar 2017 16:29:49 +0900 Subject: [PATCH] [Modify] Add it --- websocket-sharp/Server/WebSocketServer.cs | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/websocket-sharp/Server/WebSocketServer.cs b/websocket-sharp/Server/WebSocketServer.cs index 85f6e758..6621718d 100644 --- a/websocket-sharp/Server/WebSocketServer.cs +++ b/websocket-sharp/Server/WebSocketServer.cs @@ -1116,6 +1116,63 @@ namespace WebSocketSharp.Server _services.AddService (path, null); } + /// + /// Adds a WebSocket service with the specified behavior, + /// , and . + /// + /// + /// is converted to a URL-decoded string and + /// / is trimmed from the end of the converted string if any. + /// + /// + /// A that represents an absolute path to + /// the service to add. + /// + /// + /// An Action<TBehaviorWithNew> delegate that invokes + /// the method used to initialize a new session instance for + /// the service or if not needed. + /// + /// + /// The type of the behavior for the service. It must inherit + /// the class and it must have + /// a public parameterless constructor. + /// + /// + /// is . + /// + /// + /// + /// is empty. + /// + /// + /// -or- + /// + /// + /// is not an absolute path. + /// + /// + /// -or- + /// + /// + /// includes either or both + /// query and fragment components. + /// + /// + /// -or- + /// + /// + /// is already in use. + /// + /// + public void AddWebSocketService ( + string path, Action initializer + ) + where TBehaviorWithNew : WebSocketBehavior, new () + { + _services.AddService (path, initializer); + } + /// /// Removes a WebSocket service with the specified . ///