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

Represents an HTTPS session, inheriting from the SslSession class. More...

Inheritance diagram for XmobiTea.ProtonNetServer.HttpsSession:
XmobiTea.ProtonNetServer.SslSession XmobiTea.ProtonNetServer.IHttpSession XmobiTea.ProtonNetServer.ITcpSession XmobiTea.ProtonNetServer.ISession XmobiTea.ProtonNetServer.ISession XmobiTea.ProtonNet.Server.WebApi.Sessions.WebApiHttpsSession XmobiTea.ProtonNetServer.WssSession XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWssSession

Public Member Functions

 HttpsSession (HttpsServer server)
 Initializes a new instance of the HttpsSession class.
 
virtual int SendResponse (HttpResponse response)
 Sends an HTTP response synchronously.
 
virtual bool SendResponseAsync (HttpResponse response)
 Sends an HTTP response asynchronously.
 
- Public Member Functions inherited from XmobiTea.ProtonNetServer.SslSession
 SslSession (SslServer server)
 Initializes a new instance of the SslSession class.
 
INetworkStatistics GetNetworkStatistics ()
 Gets the network statistics for this session.
 
virtual bool Disconnect ()
 Disconnects the session, releasing all resources and closing the connection.
 
virtual int Send (byte[] buffer)
 Sends data to the connected client.
 
virtual int Send (byte[] buffer, int position, int length)
 Sends data to the connected client.
 
virtual bool SendAsync (byte[] buffer)
 Asynchronously sends data to the connected client.
 
virtual bool SendAsync (byte[] buffer, int position, int length)
 Asynchronously sends data to the connected client.
 
void Dispose ()
 Releases all resources used by the SslSession.
 
- Public Member Functions inherited from XmobiTea.ProtonNetServer.ISession
- Public Member Functions inherited from XmobiTea.ProtonNetServer.IHttpSession

Protected Member Functions

override void OnReceived (byte[] buffer, int position, int length)
 Handles the data received from the client.
 
override void OnDisconnected ()
 Handles the session disconnection.
 
virtual void OnReceivedRequestHeader (HttpRequest request)
 Called when the request header is received.
 
virtual void OnReceivedRequest (HttpRequest request)
 Called when the full request is received.
 
virtual void OnReceivedRequestError (HttpRequest request, string error)
 Called when an error occurs while processing the request.
 
- Protected Member Functions inherited from XmobiTea.ProtonNetServer.SslSession
virtual void OnConnecting ()
 Event triggered when the session is connecting.
 
virtual void OnConnected ()
 Event triggered when the session is connected.
 
virtual void OnHandshaking ()
 Event triggered when the SSL handshake process begins.
 
virtual void OnHandshaked ()
 Event triggered when the SSL handshake process is completed.
 
virtual void OnDisconnecting ()
 Event triggered when the session is disconnecting.
 
virtual void OnSent (int sent, int pending)
 Event triggered when data is sent to the client.
 
virtual void OnEmpty ()
 Event triggered when the send buffer is empty.
 
virtual void OnError (SocketError error)
 Event triggered when an error occurs in the session.
 
virtual void Dispose (bool disposingManagedResources)
 Releases unmanaged and, optionally, managed resources.
 

Properties

HttpRequest Request [get]
 Gets the current HTTP request being processed.
 
HttpResponse Response [get]
 Gets the current HTTP response being processed.
 
- Properties inherited from XmobiTea.ProtonNetServer.SslSession
bool IsHandshaked [get]
 Gets a value indicating whether the session has completed the SSL handshake.
 
string Id [get]
 Gets the unique identifier for this session.
 
SslServer Server [get]
 Gets the associated server instance for this session.
 
Socket Socket [get]
 Gets the underlying socket for the session.
 
bool IsConnected [get]
 Gets a value indicating whether the session is currently connected.
 
bool IsDisposed [get]
 Indicates whether this session has been disposed. This flag helps ensure that resources are not accessed after disposal.
 
bool IsSocketDisposed [get]
 Indicates whether the underlying socket has been disposed. This flag is important for preventing operations on a closed socket.
 
TcpServerOptions Options [get]
 Contains various configuration options for the TCP server. This includes settings like buffer sizes, keep-alive time, and more.
 

Detailed Description

Represents an HTTPS session, inheriting from the SslSession class.

Constructor & Destructor Documentation

◆ HttpsSession()

XmobiTea.ProtonNetServer.HttpsSession.HttpsSession ( HttpsServer server)

Initializes a new instance of the HttpsSession class.

Parameters
serverThe HTTPS server that manages this session.

Member Function Documentation

◆ OnDisconnected()

override void XmobiTea.ProtonNetServer.HttpsSession.OnDisconnected ( )
protectedvirtual

◆ OnReceived()

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

Handles the data received from the client.

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

Reimplemented from XmobiTea.ProtonNetServer.SslSession.

Reimplemented in XmobiTea.ProtonNetServer.WssSession.

◆ OnReceivedRequest()

virtual void XmobiTea.ProtonNetServer.HttpsSession.OnReceivedRequest ( HttpRequest request)
protectedvirtual

Called when the full request is received.

Parameters
requestThe HTTP request.

Reimplemented in XmobiTea.ProtonNet.Server.WebApi.Sessions.WebApiHttpsSession, and XmobiTea.ProtonNetServer.WssSession.

◆ OnReceivedRequestError()

virtual void XmobiTea.ProtonNetServer.HttpsSession.OnReceivedRequestError ( HttpRequest request,
string error )
protectedvirtual

Called when an error occurs while processing the request.

Parameters
requestThe HTTP request.
errorThe error message.

Reimplemented in XmobiTea.ProtonNet.Server.WebApi.Sessions.WebApiHttpsSession, and XmobiTea.ProtonNetServer.WssSession.

◆ OnReceivedRequestHeader()

virtual void XmobiTea.ProtonNetServer.HttpsSession.OnReceivedRequestHeader ( HttpRequest request)
protectedvirtual

Called when the request header is received.

Parameters
requestThe HTTP request.

Reimplemented in XmobiTea.ProtonNetServer.WssSession.

◆ SendResponse()

virtual int XmobiTea.ProtonNetServer.HttpsSession.SendResponse ( HttpResponse response)
virtual

Sends an HTTP response synchronously.

Parameters
responseThe HTTP response to send.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetServer.IHttpSession.

◆ SendResponseAsync()

virtual bool XmobiTea.ProtonNetServer.HttpsSession.SendResponseAsync ( HttpResponse response)
virtual

Sends an HTTP response asynchronously.

Parameters
responseThe HTTP response to send.
Returns
True if the response was sent successfully; otherwise, false.

Implements XmobiTea.ProtonNetServer.IHttpSession.


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