WebSocketServer..::..AddWebSocketService<(Of <(<'TBehavior>)>)> Method (String, Func<(Of <(<'TBehavior>)>)>)
Adds a WebSocket service with the specified behavior, path,
and initializer.
Namespace:
WebSocketSharp.ServerAssembly: C-DEngine (in C-DEngine.dll)
Syntax
public void AddWebSocketService<TBehavior>( string path, Func<TBehavior> initializer ) where TBehavior : WebSocketBehavior
Public Sub AddWebSocketService(Of TBehavior As WebSocketBehavior) ( _ path As String, _ initializer As Func(Of TBehavior) _ )
public: generic<typename TBehavior> where TBehavior : WebSocketBehavior void AddWebSocketService( String^ path, Func<TBehavior>^ initializer )
Type Parameters
- TBehavior
- The type of the behavior of the service to add. The TBehavior must inherit the WebSocketBehavior class.
Parameters
- initializer
- Type: Func<(Of <(<'TBehavior>)>)>
A Func<T> delegate that references the method used to initialize a new specified typed WebSocketBehavior instance (a new IWebSocketSession instance).
Remarks
This method converts path to URL-decoded string, and removes '/' from tail end of path.
initializer returns an initialized specified typed WebSocketBehavior instance.