From 86e68f7471878feefe4738f0199e6cc94ddf2e9f Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 6 Jun 2017 17:52:10 +0900 Subject: [PATCH] [Modify] Add it --- websocket-sharp/Server/HttpServer.cs | 66 ++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs index d419ab1c..1994bff0 100644 --- a/websocket-sharp/Server/HttpServer.cs +++ b/websocket-sharp/Server/HttpServer.cs @@ -1144,6 +1144,72 @@ namespace WebSocketSharp.Server AddWebSocketService (path, () => new TBehaviorWithNew ()); } + /// + /// 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 or + /// if not needed. + /// + /// + /// That delegate invokes the method called for initializing + /// a new session instance for the service. + /// + /// + /// + /// + /// The type of the behavior for the service. + /// + /// + /// It must inherit the class and + /// must have a public parameterless constructor. + /// + /// + /// + /// is . + /// + /// + /// + /// is an empty string. + /// + /// + /// -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); + } + /// /// Gets the contents of the file with the specified . ///