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 . ///