HttpServerAddWebSocketServiceTBehaviorWithNew Method (String, ActionTBehaviorWithNew) |
Namespace: Sfs2X.WebSocketSharp.Server
public void AddWebSocketService<TBehaviorWithNew>( string path, Action<TBehaviorWithNew> initializer ) where TBehaviorWithNew : new(), WebSocketBehavior
An Action<TBehaviorWithNew> delegate or if not needed.
That delegate invokes the method called for initializing a new session instance for the service.
The type of the behavior for the service.
It must inherit the WebSocketBehavior class and must have a public parameterless constructor.
Exception | Condition |
---|---|
ArgumentNullException | path 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. |