#ctor ( next )
Initializes the Server class.
| Name | Type | Description |
|---|
| next | Microsoft.AspNetCore.Http.RequestDelegate | - |
AcceptWebSocketRequest ()
This virtual method is invoked before the WebSocket connection is accepted.
ReturnsA value to either accept (true) or deny (false) the WebSocket connection request.
BroadCast ( message, type )
Broadcasts the message to all connected clients.
| Name | Type | Description |
|---|
| message | System.Byte[] | The data message to send. |
| type | System.Net.WebSockets.WebSocketMessageType | The message type. |
BroadCast ()
Broadcasts the message to all connected clients.
BroadCast<T> ( response )
Broadcasts the message to all connected clients.
| Name | Type | Description |
|---|
| response | Componyx.UI.Bindary.DataResponse{<T>,<T>,<T>} | The data response. |
ClientLoaded ( message, request, client )
This abstract method is invoked when a client is loaded.
| Name | Type | Description |
|---|
| message | System.String | The incoming message. |
| request | Componyx.UI.Bindary.DataRequest | The incoming message deserialized as DataRequest. |
| client | Componyx.UI.Bindary.Client | The loaded client. |
Close ( socket, status, statusDescription )
Closes the WebSocket connection.
| Name | Type | Description |
|---|
| socket | System.Net.WebSockets.WebSocket | - |
| status | System.Net.WebSockets.WebSocketCloseStatus | - |
| statusDescription | System.String | - |
Error ( ex, request, client )
Handles possible exceptions that occure inside the custom implementation while processing the request. Sending the error message to the client is usually possible. For a custom implementation this Method should be overridden in the derived class.
| Name | Type | Description |
|---|
| ex | System.Exception | - |
| request | Componyx.UI.Bindary.DataRequest | - |
| client | Componyx.UI.Bindary.Client | - |
InvokeAsync ( context )
Invokes the middleware.
| Name | Type | Description |
|---|
| context | Microsoft.AspNetCore.Http.HttpContext | - |
InvokeMethodAsync ()
Invokes the specifed method.
LoadClient ( ctxData, clientId, socket )
Load client from specified data query.
| Name | Type | Description |
|---|
| ctxData | Componyx.UI.Bindary.Server.ContextData | - |
| clientId | System.String | - |
| socket | System.Net.WebSockets.WebSocket | - |
Message ( request )
This abstract method is invoked when a DataRequest message is received from the Client.
| Name | Type | Description |
|---|
| request | Componyx.UI.Bindary.DataRequest | The incoming message deserialized as DataRequest. |
Message ( message )
This abstract method is invoked when a byte message is received from the Client.
| Name | Type | Description |
|---|
| message | System.Byte[] | The incoming message. |
Message ( message )
This abstract method is invoked when a text message is received from the Client.
| Name | Type | Description |
|---|
| message | System.String | The incoming message. |
MessageReceived ()
Handles the websocket or xhr received message event for binary messages.
MessageReceived ()
Handles the websocket or xhr received message event for binary messages.
MessageReceivedAsync ()
Handles the websocket or xhr received message event for text messages.
Open ( context )
This abstract method is invoked when a Request through either a WebSocket or XHR connection is made. In this fase the Session State object is no longer available on the current HttpContext, however it is cached in the Session property of this class.
| Name | Type | Description |
|---|
| context | Microsoft.AspNetCore.Http.HttpContext | The HTTP context of the current request. |
RemoveClient ( client )
Removes the specified client from the active client list and unsubscribes the client from the data update manager.
| Name | Type | Description |
|---|
| client | Componyx.UI.Bindary.Client | The client object. |
RemoveClient ( clientId )
Removes the client with the specified client id from the active client list and unsubscribes the client from the data update manager.
| Name | Type | Description |
|---|
| clientId | System.String | The unique client identifier. |
Send ( client, response, xhrRequestId )
Sends the data response to the specified client.
| Name | Type | Description |
|---|
| client | Componyx.UI.Bindary.Client | The client to which the data will be send |
| response | Componyx.UI.Bindary.DataResponse | The data response. |
| xhrRequestId | System.String | The identifier of the current XHR request (when applicable) to send the message as response to the current request. Without this identifier the message is stored in the queue to be returned at the first opportunity. |
Send ( client, message, type )
Sends the message to the specified client through a websocket connection (no xhr support).
| Name | Type | Description |
|---|
| client | Componyx.UI.Bindary.Client | The client to which the data will be sent. |
| message | System.Byte[] | The data message to send. |
| type | System.Net.WebSockets.WebSocketMessageType | The message type. |
Send ( client, message, xhrRequestId )
Sends the message to the specified client.
| Name | Type | Description |
|---|
| client | Componyx.UI.Bindary.Client | The client to which the data will be sent. |
| message | System.String | The data message to send. |
| xhrRequestId | System.String | The identifier of the current XHR request (when applicable) to send the message as response to the current request. Without this identifier the message is stored in the queue to be returned at the first opportunity. |
Send ( clients, response )
Sends the data response to the specified clients.
| Name | Type | Description |
|---|
| clients | System.Collections.Generic.IEnumerable{Componyx.UI.Bindary.Client} | The clients to which the data will be send. |
| response | Componyx.UI.Bindary.DataResponse | The data response. |
Send ( clients, message, type )
Sends the message to the specified clients.
| Name | Type | Description |
|---|
| clients | System.Collections.Generic.IEnumerable{Componyx.UI.Bindary.Client} | The clients to which the data will be sent. |
| message | System.Byte[] | The data message to send. |
| type | System.Net.WebSockets.WebSocketMessageType | The message type. |
Send ( clients, message )
Sends the message to the specified clients.
| Name | Type | Description |
|---|
| clients | System.Collections.Generic.List{Componyx.UI.Bindary.Client} | The clients to which the data will be sent. |
| message | System.String | The data message to send. |
ServerError ( ex )
Handles possible exceptions that occure outside the custom implementation while processing the request. Sending the error message to the client is not possible. For a custom implementation this Method should be overridden in the derived class.
| Name | Type | Description |
|---|
| ex | System.Exception | - |
UpdateClientSession ( context, sessionIdCookieOptions )
Reconnects an existing Client to a new session ID, in case the ID changes after the session was already established. Call this if you're seeing sessions unexpectedly lose their associated Client.
| Name | Type | Description |
|---|
| context | Microsoft.AspNetCore.Http.HttpContext | The current HttpContext. |
| sessionIdCookieOptions | Microsoft.AspNetCore.Http.CookieOptions | The SessionId is stored in a Cookie to be able to retrieve the connected Client if the Session has expired. |