Click or drag to resize

HttpServerAddWebSocketServiceTBehaviorWithNew Method (String, ActionTBehaviorWithNew)

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 AddWebSocketService<TBehaviorWithNew>(
	string path,
	Action<TBehaviorWithNew> initializer
)
where TBehaviorWithNew : new(), WebSocketBehavior

Parameters

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

An Action<TBehaviorWithNew> delegate or if not needed.

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

Type Parameters

TBehaviorWithNew

The type of the behavior for the service.

It must inherit the WebSocketBehavior class and must have a public parameterless constructor.

Exceptions
ExceptionCondition
ArgumentNullExceptionpath is .
ArgumentException

path is an empty string.

-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