ProtonNet Server 1.0
An Open Solution for all your socket or web api needs.
Loading...
Searching...
No Matches
XmobiTea.ProtonNetClient.WssClient Class Reference

Implements a WebSocket Secure (WSS) client over an HTTPS connection. Supports both synchronous and asynchronous operations. More...

Inheritance diagram for XmobiTea.ProtonNetClient.WssClient:
XmobiTea.ProtonNetClient.HttpsClient XmobiTea.ProtonNetCommon.IWebSocket XmobiTea.ProtonNetClient.IWsClient XmobiTea.ProtonNetClient.SslClient XmobiTea.ProtonNetClient.IHttpClient XmobiTea.ProtonNetClient.IClient XmobiTea.ProtonNetClient.ITcpClient XmobiTea.ProtonNetClient.IClient XmobiTea.ProtonNetClient.IClient XmobiTea.ProtonNet.Client.Socket.Clients.SocketWssClient

Public Member Functions

 WssClient (string address, int port, TcpClientOptions options, SslOptions sslOptions)
 Initializes a new instance of the WssClient class.
 
override bool Connect ()
 Establishes a synchronous connection to the WebSocket server.
 
override bool ConnectAsync ()
 Establishes an asynchronous connection to the WebSocket server.
 
int SendText (byte[] buffer)
 Sends a text message synchronously to the server.
 
int SendText (byte[] buffer, int position, int length)
 Sends a text message synchronously to the server.
 
bool SendTextAsync (byte[] buffer)
 Sends a text message asynchronously to the server.
 
bool SendTextAsync (byte[] buffer, int position, int length)
 Sends a text message asynchronously to the server.
 
int SendBinary (byte[] buffer)
 Sends a binary message synchronously to the server.
 
int SendBinary (byte[] buffer, int position, int length)
 Sends a binary message synchronously to the server.
 
bool SendBinaryAsync (byte[] buffer)
 Sends a binary message asynchronously to the server.
 
bool SendBinaryAsync (byte[] buffer, int position, int length)
 Sends a binary message asynchronously to the server.
 
int SendClose (int status, byte[] buffer)
 Sends a close frame with a status code synchronously to the server.
 
int SendClose (int status, byte[] buffer, int position, int length)
 Sends a close frame with a status code synchronously to the server.
 
bool SendCloseAsync (int status, byte[] buffer)
 Sends a close frame with a status code asynchronously to the server.
 
bool SendCloseAsync (int status, byte[] buffer, int position, int length)
 Sends a close frame with a status code asynchronously to the server.
 
int SendPing (byte[] buffer)
 Sends a ping frame synchronously to the server.
 
int SendPing (byte[] buffer, int position, int length)
 Sends a ping frame synchronously to the server.
 
bool SendPingAsync (byte[] buffer)
 Sends a ping frame asynchronously to the server.
 
bool SendPingAsync (byte[] buffer, int position, int length)
 Sends a ping frame asynchronously to the server.
 
int SendPong (byte[] buffer)
 Sends a pong frame synchronously to the server.
 
int SendPong (byte[] buffer, int position, int length)
 Sends a pong frame synchronously to the server.
 
bool SendPongAsync (byte[] buffer)
 Sends a pong frame asynchronously to the server.
 
bool SendPongAsync (byte[] buffer, int position, int length)
 Sends a pong frame asynchronously to the server.
 
virtual void OnWsConnecting (HttpRequest request)
 Prepares the WebSocket connection by setting the necessary headers.
 
virtual void OnWsConnected (HttpResponse response)
 Called when the WebSocket connection is successfully established.
 
virtual void OnWsConnected (HttpRequest request)
 Called when the WebSocket connection is successfully established.
 
virtual bool OnWsConnecting (HttpRequest request, HttpResponse response)
 OnWsConnecting.
 
virtual void OnWsDisconnecting ()
 Called when the WebSocket connection is in the process of disconnecting.
 
virtual void OnWsDisconnected ()
 Called when the WebSocket connection is successfully disconnected.
 
virtual void OnWsReceived (byte[] buffer, int position, int length)
 Processes the WebSocket frames received from the server.
 
virtual void OnWsClose (byte[] buffer, int position, int length, int status=1000)
 Handles a close frame received from the server.
 
virtual void OnWsPing (byte[] buffer, int position, int length)
 Handles a ping frame received from the server by sending a pong frame.
 
virtual void OnWsPong (byte[] buffer, int position, int length)
 Handles a pong frame received from the server.
 
virtual void OnWsError (string error)
 Handles a WebSocket error by reporting it to the client.
 
virtual void OnWsError (SocketError error)
 Handles a WebSocket error by reporting it to the client.
 
void SendUpgrade (HttpResponse response)
 Upgrades the HTTP connection to a WebSocket connection.
 
- Public Member Functions inherited from XmobiTea.ProtonNetClient.HttpsClient
 HttpsClient (string address, int port, TcpClientOptions options, SslOptions sslOptions)
 Initializes a new instance of the HttpsClient class.
 
int SendRequest (HttpRequest request)
 Sends an HTTP request synchronously using the provided request data.
 
bool SendRequestAsync (HttpRequest request)
 Sends an HTTP request asynchronously using the provided request data.
 
- Public Member Functions inherited from XmobiTea.ProtonNetClient.SslClient
 SslClient (string address, int port, TcpClientOptions options, SslOptions sslOptions)
 Initializes a new instance of the SslClient class.
 
INetworkStatistics GetNetworkStatistics ()
 Gets the network statistics associated with the client.
 
virtual bool Disconnect ()
 Disconnects the client from the server synchronously.
 
virtual bool Reconnect ()
 Reconnects the client to the server by first disconnecting, then reconnecting and initiating the SSL/TLS handshake.
 
virtual bool DisconnectAsync ()
 Disconnects the client from the server asynchronously.
 
virtual bool ReconnectAsync ()
 Reconnects the client to the server asynchronously by first disconnecting, then reconnecting and initiating the SSL/TLS handshake.
 
virtual int Send (byte[] buffer)
 Sends data to the server synchronously through the SSL/TLS stream.
 
virtual int Send (byte[] buffer, int position, int length)
 Sends data to the server synchronously through the SSL/TLS stream starting from a specific position in the buffer.
 
virtual bool SendAsync (byte[] buffer)
 Sends data to the server asynchronously through the SSL/TLS stream.
 
virtual bool SendAsync (byte[] buffer, int position, int length)
 Sends data to the server asynchronously through the SSL/TLS stream starting from a specific position in the buffer.
 
void Dispose ()
 Disposes the SSL client, releasing all resources.
 
- Public Member Functions inherited from XmobiTea.ProtonNetClient.IClient
- Public Member Functions inherited from XmobiTea.ProtonNetClient.IHttpClient
- Public Member Functions inherited from XmobiTea.ProtonNetCommon.IWebSocket
- Public Member Functions inherited from XmobiTea.ProtonNetClient.IWsClient

Protected Member Functions

override void OnConnecting ()
 Called when the client is in the process of connecting to the server.
 
override void OnConnected ()
 Called when the client has successfully connected to the server.
 
override void OnHandshaking ()
 Called when the SSL/TLS handshake is in progress.
 
override void OnHandshaked ()
 Called when the SSL/TLS handshake is successfully completed.
 
override void OnDisconnecting ()
 Called when the client is in the process of disconnecting.
 
override void OnDisconnected ()
 Called when the client has successfully disconnected from the server.
 
override void OnReceived (byte[] buffer, int position, int length)
 Processes the data received from the server.
 
override void OnReceivedResponseHeader (HttpResponse response)
 Processes the response header received from the server.
 
override void OnReceivedResponse (HttpResponse response)
 Processes the response body received from the server.
 
override void OnReceivedResponseError (HttpResponse response, string error)
 Handles errors in the response received from the server.
 
- Protected Member Functions inherited from XmobiTea.ProtonNetClient.HttpsClient
- Protected Member Functions inherited from XmobiTea.ProtonNetClient.SslClient
virtual void OnSent (int sent, int pending)
 Called when data is successfully sent to the server through the SSL/TLS stream. Can be overridden in derived classes to handle the event.
 
virtual void OnEmpty ()
 Called when the send buffer is empty. Can be overridden in derived classes to handle the event.
 
virtual void OnError (SocketError error)
 Called when an error occurs during socket operations. Can be overridden in derived classes to handle the event.
 
virtual void Dispose (bool disposingManagedResources)
 Disposes the SSL client, releasing managed resources if specified.
 

Properties

byte[] WsNonce [get]
 Gets the WebSocket nonce used during the handshake.
 
- Properties inherited from XmobiTea.ProtonNetClient.HttpsClient
HttpRequest Request [get]
 Gets the current HTTP request being processed by the client.
 
HttpResponse Response [get]
 Gets the current HTTP response received from the server.
 
- Properties inherited from XmobiTea.ProtonNetClient.SslClient
SslOptions SslOptions [get]
 Gets the Ssl options used for SSL/TLS encryption and authentication.
 
bool IsHandshaking [get]
 Gets a value indicating whether the SSL/TLS handshake is in progress.
 
bool IsHandshaked [get]
 Gets a value indicating whether the SSL/TLS handshake has been completed.
 
string Id [get]
 A unique identifier for this client instance.
 
string Address [get]
 The address of the remote server to which the client is connecting.
 
int Port [get]
 The port number on the remote server to which the client is connecting.
 
EndPoint EndPoint [get]
 The endpoint representing the address and port of the remote server.
 
Socket Socket [get]
 The socket used for network communication.
 
TcpClientOptions Options [get]
 Configuration options for the TCP client.
 
bool IsConnecting [get]
 Indicates whether the client is currently in the process of connecting.
 
bool IsConnected [get]
 Indicates whether the client is currently connected to the server.
 
bool IsDisposed [get]
 Indicates whether the client has been disposed.
 
bool IsSocketDisposed [get]
 Indicates whether the socket has been disposed.
 

Detailed Description

Implements a WebSocket Secure (WSS) client over an HTTPS connection. Supports both synchronous and asynchronous operations.

Constructor & Destructor Documentation

◆ WssClient()

XmobiTea.ProtonNetClient.WssClient.WssClient ( string address,
int port,
TcpClientOptions options,
SslOptions sslOptions )

Initializes a new instance of the WssClient class.

Parameters
addressThe server address to connect to.
portThe port number on the server.
optionsTCP client options for configuring the connection.
sslOptionsThe Ssl options used for establishing the secure connection.

Member Function Documentation

◆ Connect()

override bool XmobiTea.ProtonNetClient.WssClient.Connect ( )
virtual

Establishes a synchronous connection to the WebSocket server.

Returns
True if connected successfully, otherwise false.

Reimplemented from XmobiTea.ProtonNetClient.SslClient.

◆ ConnectAsync()

override bool XmobiTea.ProtonNetClient.WssClient.ConnectAsync ( )
virtual

Establishes an asynchronous connection to the WebSocket server.

Returns
True if connection initiation is successful, otherwise false.

Reimplemented from XmobiTea.ProtonNetClient.SslClient.

◆ OnConnected()

override void XmobiTea.ProtonNetClient.WssClient.OnConnected ( )
protectedvirtual

Called when the client has successfully connected to the server.

Reimplemented from XmobiTea.ProtonNetClient.SslClient.

◆ OnConnecting()

override void XmobiTea.ProtonNetClient.WssClient.OnConnecting ( )
protectedvirtual

Called when the client is in the process of connecting to the server.

Reimplemented from XmobiTea.ProtonNetClient.SslClient.

◆ OnDisconnected()

override void XmobiTea.ProtonNetClient.WssClient.OnDisconnected ( )
protectedvirtual

Called when the client has successfully disconnected from the server.

Reimplemented from XmobiTea.ProtonNetClient.HttpsClient.

◆ OnDisconnecting()

override void XmobiTea.ProtonNetClient.WssClient.OnDisconnecting ( )
protectedvirtual

Called when the client is in the process of disconnecting.

Reimplemented from XmobiTea.ProtonNetClient.SslClient.

◆ OnHandshaked()

override void XmobiTea.ProtonNetClient.WssClient.OnHandshaked ( )
protectedvirtual

Called when the SSL/TLS handshake is successfully completed.

Reimplemented from XmobiTea.ProtonNetClient.SslClient.

◆ OnHandshaking()

override void XmobiTea.ProtonNetClient.WssClient.OnHandshaking ( )
protectedvirtual

Called when the SSL/TLS handshake is in progress.

Reimplemented from XmobiTea.ProtonNetClient.SslClient.

◆ OnReceived()

override void XmobiTea.ProtonNetClient.WssClient.OnReceived ( byte[] buffer,
int position,
int length )
protectedvirtual

Processes the data received from the server.

Parameters
bufferThe buffer containing the received data.
positionThe starting position in the buffer.
lengthThe length of the received data.

Reimplemented from XmobiTea.ProtonNetClient.HttpsClient.

◆ OnReceivedResponse()

override void XmobiTea.ProtonNetClient.WssClient.OnReceivedResponse ( HttpResponse response)
protectedvirtual

Processes the response body received from the server.

Parameters
responseThe HTTP response received.

Reimplemented from XmobiTea.ProtonNetClient.HttpsClient.

◆ OnReceivedResponseError()

override void XmobiTea.ProtonNetClient.WssClient.OnReceivedResponseError ( HttpResponse response,
string error )
protectedvirtual

Handles errors in the response received from the server.

Parameters
responseThe HTTP response that caused the error.
errorThe error message.

Reimplemented from XmobiTea.ProtonNetClient.HttpsClient.

◆ OnReceivedResponseHeader()

override void XmobiTea.ProtonNetClient.WssClient.OnReceivedResponseHeader ( HttpResponse response)
protectedvirtual

Processes the response header received from the server.

Parameters
responseThe HTTP response received.

Reimplemented from XmobiTea.ProtonNetClient.HttpsClient.

◆ OnWsClose()

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsClose ( byte[] buffer,
int position,
int length,
int status = 1000 )
virtual

Handles a close frame received from the server.

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

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsConnected() [1/2]

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsConnected ( HttpRequest request)
virtual

Called when the WebSocket connection is successfully established.

Parameters
requestThe HTTP request that initiated the WebSocket connection.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsConnected() [2/2]

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsConnected ( HttpResponse response)
virtual

Called when the WebSocket connection is successfully established.

Parameters
responseThe HTTP response that confirms the WebSocket upgrade.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

Reimplemented in XmobiTea.ProtonNet.Client.Socket.Clients.SocketWssClient.

◆ OnWsConnecting() [1/2]

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsConnecting ( HttpRequest request)
virtual

Prepares the WebSocket connection by setting the necessary headers.

Parameters
requestThe HTTP request being sent to initiate the WebSocket connection.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsConnecting() [2/2]

virtual bool XmobiTea.ProtonNetClient.WssClient.OnWsConnecting ( HttpRequest request,
HttpResponse response )
virtual

OnWsConnecting.

Parameters
requestThe HTTP request that initiated the WebSocket connection.
responseThe HTTP response that initiated the WebSocket connection.
Returns

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsDisconnected()

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsDisconnected ( )
virtual

Called when the WebSocket connection is successfully disconnected.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsDisconnecting()

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsDisconnecting ( )
virtual

Called when the WebSocket connection is in the process of disconnecting.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsError() [1/2]

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsError ( SocketError error)
virtual

Handles a WebSocket error by reporting it to the client.

Parameters
errorThe socket error.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsError() [2/2]

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsError ( string error)
virtual

Handles a WebSocket error by reporting it to the client.

Parameters
errorThe error message.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsPing()

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsPing ( byte[] buffer,
int position,
int length )
virtual

Handles a ping frame received from the server by sending a pong frame.

Parameters
bufferThe buffer containing the ping frame.
positionThe starting position in the buffer.
lengthThe length of the ping frame.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsPong()

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsPong ( byte[] buffer,
int position,
int length )
virtual

Handles a pong frame received from the server.

Parameters
bufferThe buffer containing the pong frame.
positionThe starting position in the buffer.
lengthThe length of the pong frame.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

◆ OnWsReceived()

virtual void XmobiTea.ProtonNetClient.WssClient.OnWsReceived ( byte[] buffer,
int position,
int length )
virtual

Processes the WebSocket frames received from the server.

Parameters
bufferThe buffer containing the received data.
positionThe starting position in the buffer.
lengthThe length of the received data.

Implements XmobiTea.ProtonNetCommon.IWebSocket.

Reimplemented in XmobiTea.ProtonNet.Client.Socket.Clients.SocketWssClient.

◆ SendBinary() [1/2]

int XmobiTea.ProtonNetClient.WssClient.SendBinary ( byte[] buffer)

Sends a binary message synchronously to the server.

Parameters
bufferThe byte array containing the binary message.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendBinary() [2/2]

int XmobiTea.ProtonNetClient.WssClient.SendBinary ( byte[] buffer,
int position,
int length )

Sends a binary message synchronously to the server.

Parameters
bufferThe byte array containing the binary message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendBinaryAsync() [1/2]

bool XmobiTea.ProtonNetClient.WssClient.SendBinaryAsync ( byte[] buffer)

Sends a binary message asynchronously to the server.

Parameters
bufferThe byte array containing the binary message.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendBinaryAsync() [2/2]

bool XmobiTea.ProtonNetClient.WssClient.SendBinaryAsync ( byte[] buffer,
int position,
int length )

Sends a binary message asynchronously to the server.

Parameters
bufferThe byte array containing the binary message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendClose() [1/2]

int XmobiTea.ProtonNetClient.WssClient.SendClose ( int status,
byte[] buffer )

Sends a close frame with a status code synchronously to the server.

Parameters
statusThe close status code.
bufferThe byte array containing the close message.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendClose() [2/2]

int XmobiTea.ProtonNetClient.WssClient.SendClose ( int status,
byte[] buffer,
int position,
int length )

Sends a close frame with a status code synchronously to the server.

Parameters
statusThe close status code.
bufferThe byte array containing the close message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendCloseAsync() [1/2]

bool XmobiTea.ProtonNetClient.WssClient.SendCloseAsync ( int status,
byte[] buffer )

Sends a close frame with a status code asynchronously to the server.

Parameters
statusThe close status code.
bufferThe byte array containing the close message.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendCloseAsync() [2/2]

bool XmobiTea.ProtonNetClient.WssClient.SendCloseAsync ( int status,
byte[] buffer,
int position,
int length )

Sends a close frame with a status code asynchronously to the server.

Parameters
statusThe close status code.
bufferThe byte array containing the close message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendPing() [1/2]

int XmobiTea.ProtonNetClient.WssClient.SendPing ( byte[] buffer)

Sends a ping frame synchronously to the server.

Parameters
bufferThe byte array containing the ping message.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendPing() [2/2]

int XmobiTea.ProtonNetClient.WssClient.SendPing ( byte[] buffer,
int position,
int length )

Sends a ping frame synchronously to the server.

Parameters
bufferThe byte array containing the ping message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendPingAsync() [1/2]

bool XmobiTea.ProtonNetClient.WssClient.SendPingAsync ( byte[] buffer)

Sends a ping frame asynchronously to the server.

Parameters
bufferThe byte array containing the ping message.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendPingAsync() [2/2]

bool XmobiTea.ProtonNetClient.WssClient.SendPingAsync ( byte[] buffer,
int position,
int length )

Sends a ping frame asynchronously to the server.

Parameters
bufferThe byte array containing the ping message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendPong() [1/2]

int XmobiTea.ProtonNetClient.WssClient.SendPong ( byte[] buffer)

Sends a pong frame synchronously to the server.

Parameters
bufferThe byte array containing the pong message.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendPong() [2/2]

int XmobiTea.ProtonNetClient.WssClient.SendPong ( byte[] buffer,
int position,
int length )

Sends a pong frame synchronously to the server.

Parameters
bufferThe byte array containing the pong message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendPongAsync() [1/2]

bool XmobiTea.ProtonNetClient.WssClient.SendPongAsync ( byte[] buffer)

Sends a pong frame asynchronously to the server.

Parameters
bufferThe byte array containing the pong message.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendPongAsync() [2/2]

bool XmobiTea.ProtonNetClient.WssClient.SendPongAsync ( byte[] buffer,
int position,
int length )

Sends a pong frame asynchronously to the server.

Parameters
bufferThe byte array containing the pong message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendText() [1/2]

int XmobiTea.ProtonNetClient.WssClient.SendText ( byte[] buffer)

Sends a text message synchronously to the server.

Parameters
bufferThe byte array containing the text message.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendText() [2/2]

int XmobiTea.ProtonNetClient.WssClient.SendText ( byte[] buffer,
int position,
int length )

Sends a text message synchronously to the server.

Parameters
bufferThe byte array containing the text message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendTextAsync() [1/2]

bool XmobiTea.ProtonNetClient.WssClient.SendTextAsync ( byte[] buffer)

Sends a text message asynchronously to the server.

Parameters
bufferThe byte array containing the text message.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendTextAsync() [2/2]

bool XmobiTea.ProtonNetClient.WssClient.SendTextAsync ( byte[] buffer,
int position,
int length )

Sends a text message asynchronously to the server.

Parameters
bufferThe byte array containing the text message.
positionThe starting position in the buffer.
lengthThe number of bytes to send.
Returns
True if the message was sent successfully, otherwise false.

Implements XmobiTea.ProtonNetClient.IWsClient.

◆ SendUpgrade()

void XmobiTea.ProtonNetClient.WssClient.SendUpgrade ( HttpResponse response)

Upgrades the HTTP connection to a WebSocket connection.

Parameters
responseThe HTTP response confirming the upgrade.

Implements XmobiTea.ProtonNetCommon.IWebSocket.


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