Click or drag to resize

WebSocketServiceManagerAddServiceTBehavior Method

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

Namespace:  Sfs2X.WebSocketSharp.Server
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public void AddService<TBehavior>(
	string path,
	Action<TBehavior> initializer
)
where TBehavior : new(), WebSocketBehavior

Parameters

path
Type: SystemString
A String that represents an absolute path to the service to add.
initializer
Type: SystemActionTBehavior

An Action<TBehavior> delegate or if not needed.

That delegate invokes the method called for initializing a new session instance for the service.

Type Parameters

TBehavior
The type of the behavior for the service. It must inherit the WebSocketBehavior class and it must have a public parameterless constructor.
Exceptions
ExceptionCondition
ArgumentNullExceptionpath is .
ArgumentException

path is empty.

-or-

path is not an absolute path.

-or-

path includes either or both query and fragment components.

-or-

path is already in use.

Remarks
path is converted to a URL-decoded string and / is trimmed from the end of the converted string if any.
See Also