Click or drag to resize

WebSocketServerAddWebSocketServiceTBehavior Method (String, FuncTBehavior)

Note: This API is now obsolete.

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

Namespace:  Sfs2X.WebSocketSharp.Server
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
[ObsoleteAttribute("This method will be removed. Use added one instead.")]
public void AddWebSocketService<TBehavior>(
	string path,
	Func<TBehavior> creator
)
where TBehavior : WebSocketBehavior

Parameters

path
Type: SystemString
A String that represents an absolute path to the service to add.
creator
Type: SystemFuncTBehavior

A Func<TBehavior> delegate.

It invokes the method called for creating a new session instance for the service.

The method must create a new instance of the specified behavior class and return it.

Type Parameters

TBehavior

The type of the behavior for the service.

It must inherit the WebSocketBehavior class.

Exceptions
ExceptionCondition
ArgumentNullException

path is .

-or-

creator 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