Represents an HTTPS client that handles sending requests and receiving responses over an SSL/TLS-encrypted TCP connection.
More...
|
| | 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.
|
| |
| | 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 | Connect () |
| | Connects the client to the server synchronously and initiates the SSL/TLS handshake.
|
| |
| 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 | ConnectAsync () |
| | Connects the client to the server asynchronously and initiates 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.
|
| |
|
| override void | OnReceived (byte[] buffer, int position, int length) |
| | Handles data received from the server. Processes HTTP response headers and body data accordingly.
|
| |
| override void | OnDisconnected () |
| | Handles the disconnection event and processes any remaining HTTP response body data.
|
| |
| virtual void | OnReceivedResponseHeader (HttpResponse response) |
| | Called when an HTTP response header has been successfully received. Can be overridden in derived classes to handle the event.
|
| |
| virtual void | OnReceivedResponse (HttpResponse response) |
| | Called when an entire HTTP response has been successfully received. Can be overridden in derived classes to handle the event.
|
| |
| virtual void | OnReceivedResponseError (HttpResponse response, string error) |
| | Called when an error occurs during the processing of an HTTP response. Can be overridden in derived classes to handle the event.
|
| |
| virtual void | OnConnecting () |
| | Called when the client is in the process of connecting. Can be overridden in derived classes to handle the event.
|
| |
| virtual void | OnConnected () |
| | Called when the client has successfully connected to the server. Can be overridden in derived classes to handle the event.
|
| |
| virtual void | OnHandshaking () |
| | Called when the SSL/TLS handshake is in progress. Can be overridden in derived classes to handle the event.
|
| |
| virtual void | OnHandshaked () |
| | Called when the SSL/TLS handshake has been completed. Can be overridden in derived classes to handle the event.
|
| |
| virtual void | OnDisconnecting () |
| | Called when the client is in the process of disconnecting. Can be overridden in derived classes to handle the event.
|
| |
| 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.
|
| |
|
|
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.
|
| |
|
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.
|
| |
Represents an HTTPS client that handles sending requests and receiving responses over an SSL/TLS-encrypted TCP connection.
◆ HttpsClient()
Initializes a new instance of the HttpsClient class.
- Parameters
-
| address | The server address to connect to. |
| port | The port number on the server. |
| options | TCP client options for configuring the connection. |
| sslOptions | The SSL/TLS context for secure communication. |
◆ OnDisconnected()
| override void XmobiTea.ProtonNetClient.HttpsClient.OnDisconnected |
( |
| ) |
|
|
protectedvirtual |
◆ OnReceived()
| override void XmobiTea.ProtonNetClient.HttpsClient.OnReceived |
( |
byte[] | buffer, |
|
|
int | position, |
|
|
int | length ) |
|
protectedvirtual |
Handles data received from the server. Processes HTTP response headers and body data accordingly.
- Parameters
-
| buffer | The buffer containing the received data. |
| position | The starting position in the buffer. |
| length | The length of the received data. |
Reimplemented from XmobiTea.ProtonNetClient.SslClient.
Reimplemented in XmobiTea.ProtonNetClient.WssClient.
◆ OnReceivedResponse()
| virtual void XmobiTea.ProtonNetClient.HttpsClient.OnReceivedResponse |
( |
HttpResponse | response | ) |
|
|
protectedvirtual |
Called when an entire HTTP response has been successfully received. Can be overridden in derived classes to handle the event.
- Parameters
-
| response | The received HTTP response. |
Reimplemented in XmobiTea.ProtonNetClient.WssClient.
◆ OnReceivedResponseError()
| virtual void XmobiTea.ProtonNetClient.HttpsClient.OnReceivedResponseError |
( |
HttpResponse | response, |
|
|
string | error ) |
|
protectedvirtual |
Called when an error occurs during the processing of an HTTP response. Can be overridden in derived classes to handle the event.
- Parameters
-
| response | The received HTTP response that caused the error. |
| error | A message describing the error. |
Reimplemented in XmobiTea.ProtonNetClient.WssClient.
◆ OnReceivedResponseHeader()
| virtual void XmobiTea.ProtonNetClient.HttpsClient.OnReceivedResponseHeader |
( |
HttpResponse | response | ) |
|
|
protectedvirtual |
Called when an HTTP response header has been successfully received. Can be overridden in derived classes to handle the event.
- Parameters
-
| response | The received HTTP response. |
Reimplemented in XmobiTea.ProtonNetClient.WssClient.
◆ SendRequest()
| int XmobiTea.ProtonNetClient.HttpsClient.SendRequest |
( |
HttpRequest | request | ) |
|
Sends an HTTP request synchronously using the provided request data.
- Parameters
-
| request | The HTTP request to be sent. |
- Returns
- The number of bytes sent.
Implements XmobiTea.ProtonNetClient.IHttpClient.
◆ SendRequestAsync()
| bool XmobiTea.ProtonNetClient.HttpsClient.SendRequestAsync |
( |
HttpRequest | request | ) |
|
Sends an HTTP request asynchronously using the provided request data.
- Parameters
-
| request | The HTTP request to be sent. |
- Returns
- True if the request was sent successfully; otherwise, false.
Implements XmobiTea.ProtonNetClient.IHttpClient.
The documentation for this class was generated from the following file:
- XmobiTea.ProtonNetClient/IHttpClient.cs