Class WebSocketServerOptions
- Namespace
- Alis.Core.Network
- Assembly
- Alis.dll
Server WebSocket init options
public class WebSocketServerOptions
Inheritance
Inherited Members
Constructors
WebSocketServerOptions()
Initialises a new instance of the WebSocketServerOptions class
public WebSocketServerOptions()
WebSocketServerOptions(double, bool, string)
Initializes a new instance of the Alis.Core.Network.WebSocketServerOptions class
public WebSocketServerOptions(double keepAliveInterval, bool includeExceptionInCloseResponse, string subProtocol)
Parameters
keepAliveInterval
double-
The keep alive interval
includeExceptionInCloseResponse
bool-
The include exception in close response
subProtocol
string-
The sub protocol
WebSocketServerOptions(TimeSpan, string)
Initializes a new instance of the Alis.Core.Network.WebSocketServerOptions class
public WebSocketServerOptions(TimeSpan keepAliveInterval, string subProtocol)
Parameters
Properties
IncludeExceptionInCloseResponse
Include the full exception (with stack trace) in the close response when an exception is encountered and the WebSocket connection is closed The default is false
public bool IncludeExceptionInCloseResponse { get; }
Property Value
KeepAliveInterval
How often to send ping requests to the Client The default is 60 seconds This is done to prevent proxy servers from closing your connection A timespan of zero will disable the automatic ping pong mechanism You can manually control ping pong messages using the PingPongManager class. If you do that it is advisable to set this KeepAliveInterval to zero in the WebSocketServerFactory
public TimeSpan KeepAliveInterval { get; }
Property Value
SubProtocol
Specifies the sub protocol to send back to the client in the opening handshake Can be null (the most common use case) The client can specify multiple preferred protocols in the opening handshake header The server should use the first supported one or set this to null if none of the requested sub protocols are supported
public string SubProtocol { get; }