C-DEngine 5.105

WebSocketServer..::..AddWebSocketService<(Of <(<'TBehavior>)>)> Method (String, Func<(Of <(<'TBehavior>)>)>)

Adds a WebSocket service with the specified behavior, path, and initializer.

Namespace:  WebSocketSharp.Server
Assembly:  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

path
Type: String
A String that represents the absolute path to the service to add.
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.