ProtonNet Server 1.0
An Open Solution for all your socket or web api needs.
Loading...
Searching...
No Matches
XmobiTea.ProtonNetCommon.IWebSocket Interface Reference

Interface defining the contract for WebSocket operations and events. More...

Inheritance diagram for XmobiTea.ProtonNetCommon.IWebSocket:
XmobiTea.ProtonNetClient.WsClient XmobiTea.ProtonNetClient.WssClient XmobiTea.ProtonNetCommon.WebSocket XmobiTea.ProtonNetServer.WsServer XmobiTea.ProtonNetServer.WsSession XmobiTea.ProtonNetServer.WssServer XmobiTea.ProtonNetServer.WssSession XmobiTea.ProtonNet.Client.Socket.Clients.SocketWsClient XmobiTea.ProtonNet.Client.Socket.Clients.SocketWssClient XmobiTea.ProtonNet.Server.Socket.Server.SocketWsServer XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWsSession XmobiTea.ProtonNet.Server.Socket.Server.SocketWssServer XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWssSession

Public Member Functions

void OnWsConnecting (HttpRequest request)
 Invoked when a WebSocket connection is being established.
 
void OnWsConnected (HttpResponse response)
 Invoked when a WebSocket connection has been successfully established.
 
bool OnWsConnecting (HttpRequest request, HttpResponse response)
 Invoked when a WebSocket connection is being established, allowing to modify the response.
 
void OnWsConnected (HttpRequest request)
 Invoked when a WebSocket connection has been successfully established.
 
void OnWsDisconnecting ()
 Invoked when a WebSocket connection is about to be closed.
 
void OnWsDisconnected ()
 Invoked when a WebSocket connection has been closed.
 
void OnWsReceived (byte[] buffer, int position, int length)
 Invoked when a WebSocket message has been received.
 
void OnWsClose (byte[] buffer, int position, int length, int status=1000)
 Invoked when a WebSocket close frame has been received.
 
void OnWsPing (byte[] buffer, int position, int length)
 Invoked when a WebSocket ping frame has been received.
 
void OnWsPong (byte[] buffer, int position, int length)
 Invoked when a WebSocket pong frame has been received.
 
void OnWsError (string error)
 Invoked when a WebSocket error occurs, providing an error message.
 
void OnWsError (SocketError error)
 Invoked when a WebSocket error occurs, providing a SocketError.
 
void SendUpgrade (HttpResponse response)
 Sends an HTTP response to complete the WebSocket upgrade process.
 

Detailed Description

Interface defining the contract for WebSocket operations and events.

Member Function Documentation

◆ OnWsClose()

void XmobiTea.ProtonNetCommon.IWebSocket.OnWsClose ( byte[] buffer,
int position,
int length,
int status = 1000 )

Invoked when a WebSocket close frame has been received.

Parameters
bufferThe buffer containing the close frame data.
positionThe position in the buffer where the data starts.
lengthThe length of the close frame data.
statusThe close status code.

Implemented in XmobiTea.ProtonNetClient.WsClient, XmobiTea.ProtonNetClient.WssClient, XmobiTea.ProtonNetCommon.WebSocket, XmobiTea.ProtonNetServer.WsServer, XmobiTea.ProtonNetServer.WsSession, XmobiTea.ProtonNetServer.WssServer, and XmobiTea.ProtonNetServer.WssSession.

◆ OnWsConnected() [1/2]

◆ OnWsConnected() [2/2]

◆ OnWsConnecting() [1/2]

void XmobiTea.ProtonNetCommon.IWebSocket.OnWsConnecting ( HttpRequest request)

◆ OnWsConnecting() [2/2]

bool XmobiTea.ProtonNetCommon.IWebSocket.OnWsConnecting ( HttpRequest request,
HttpResponse response )

Invoked when a WebSocket connection is being established, allowing to modify the response.

Parameters
requestThe HTTP request initiating the connection.
responseThe HTTP response confirming the connection.
Returns
True if the connection should be accepted; otherwise, false.

Implemented in XmobiTea.ProtonNetClient.WsClient, XmobiTea.ProtonNetClient.WssClient, XmobiTea.ProtonNetCommon.WebSocket, XmobiTea.ProtonNetServer.WsServer, XmobiTea.ProtonNetServer.WsSession, XmobiTea.ProtonNetServer.WssServer, and XmobiTea.ProtonNetServer.WssSession.

◆ OnWsDisconnected()

◆ OnWsDisconnecting()

◆ OnWsError() [1/2]

void XmobiTea.ProtonNetCommon.IWebSocket.OnWsError ( SocketError error)

◆ OnWsError() [2/2]

void XmobiTea.ProtonNetCommon.IWebSocket.OnWsError ( string error)

◆ OnWsPing()

void XmobiTea.ProtonNetCommon.IWebSocket.OnWsPing ( byte[] buffer,
int position,
int length )

Invoked when a WebSocket ping frame has been received.

Parameters
bufferThe buffer containing the ping frame data.
positionThe position in the buffer where the data starts.
lengthThe length of the ping frame data.

Implemented in XmobiTea.ProtonNetClient.WsClient, XmobiTea.ProtonNetClient.WssClient, XmobiTea.ProtonNetCommon.WebSocket, XmobiTea.ProtonNetServer.WsServer, XmobiTea.ProtonNetServer.WsSession, XmobiTea.ProtonNetServer.WssServer, and XmobiTea.ProtonNetServer.WssSession.

◆ OnWsPong()

void XmobiTea.ProtonNetCommon.IWebSocket.OnWsPong ( byte[] buffer,
int position,
int length )

Invoked when a WebSocket pong frame has been received.

Parameters
bufferThe buffer containing the pong frame data.
positionThe position in the buffer where the data starts.
lengthThe length of the pong frame data.

Implemented in XmobiTea.ProtonNetClient.WsClient, XmobiTea.ProtonNetClient.WssClient, XmobiTea.ProtonNetCommon.WebSocket, XmobiTea.ProtonNetServer.WsServer, XmobiTea.ProtonNetServer.WsSession, XmobiTea.ProtonNetServer.WssServer, and XmobiTea.ProtonNetServer.WssSession.

◆ OnWsReceived()

void XmobiTea.ProtonNetCommon.IWebSocket.OnWsReceived ( byte[] buffer,
int position,
int length )

◆ SendUpgrade()

void XmobiTea.ProtonNetCommon.IWebSocket.SendUpgrade ( HttpResponse response)

The documentation for this interface was generated from the following file: