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

Represents a secure SSL session with the ability to manage connection, data transmission, and handshake processes. More...

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

Public Member Functions

 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

Protected Member Functions

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 OnDisconnected ()
 Event triggered when the session is disconnected.
 
virtual void OnReceived (byte[] buffer, int position, int length)
 Event triggered when data is received from the client.
 
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

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 a secure SSL session with the ability to manage connection, data transmission, and handshake processes.

Constructor & Destructor Documentation

◆ SslSession()

XmobiTea.ProtonNetServer.SslSession.SslSession ( SslServer server)

Initializes a new instance of the SslSession class.

Parameters
serverThe SSL server associated with this session.

Member Function Documentation

◆ Disconnect()

virtual bool XmobiTea.ProtonNetServer.SslSession.Disconnect ( )
virtual

Disconnects the session, releasing all resources and closing the connection.

Returns
True if disconnection was successful; otherwise, false.

Implements XmobiTea.ProtonNetServer.ISession.

◆ Dispose()

virtual void XmobiTea.ProtonNetServer.SslSession.Dispose ( bool disposingManagedResources)
protectedvirtual

Releases unmanaged and, optionally, managed resources.

Parameters
disposingManagedResourcesTrue to release both managed and unmanaged resources; false to release only unmanaged resources.

Reimplemented in XmobiTea.ProtonNet.Server.Socket.Sessions.SocketSslSession, and XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWssSession.

◆ GetNetworkStatistics()

INetworkStatistics XmobiTea.ProtonNetServer.SslSession.GetNetworkStatistics ( )

Gets the network statistics for this session.

Returns
The network statistics object.

Implements XmobiTea.ProtonNetServer.ISession.

◆ OnConnected()

virtual void XmobiTea.ProtonNetServer.SslSession.OnConnected ( )
protectedvirtual

◆ OnDisconnected()

virtual void XmobiTea.ProtonNetServer.SslSession.OnDisconnected ( )
protectedvirtual

◆ OnDisconnecting()

virtual void XmobiTea.ProtonNetServer.SslSession.OnDisconnecting ( )
protectedvirtual

Event triggered when the session is disconnecting.

Reimplemented in XmobiTea.ProtonNetServer.WssSession.

◆ OnError()

virtual void XmobiTea.ProtonNetServer.SslSession.OnError ( SocketError error)
protectedvirtual

Event triggered when an error occurs in the session.

Parameters
errorThe socket error that occurred.

◆ OnReceived()

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

Event triggered when data is received from the client.

Parameters
bufferThe buffer containing the received data.
positionThe position in the buffer where the data starts.
lengthThe number of bytes received.

Reimplemented in XmobiTea.ProtonNet.Server.Socket.Sessions.SocketSslSession, XmobiTea.ProtonNetServer.HttpsSession, and XmobiTea.ProtonNetServer.WssSession.

◆ OnSent()

virtual void XmobiTea.ProtonNetServer.SslSession.OnSent ( int sent,
int pending )
protectedvirtual

Event triggered when data is sent to the client.

Parameters
sentThe number of bytes sent.
pendingThe number of bytes pending to be sent.

◆ Send() [1/2]

virtual int XmobiTea.ProtonNetServer.SslSession.Send ( byte[] buffer)
virtual

Sends data to the connected client.

Parameters
bufferThe data buffer to send.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetServer.ISession.

Reimplemented in XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWssSession.

◆ Send() [2/2]

virtual int XmobiTea.ProtonNetServer.SslSession.Send ( byte[] buffer,
int position,
int length )
virtual

Sends data to the connected client.

Parameters
bufferThe data buffer to send.
positionThe position in the buffer at which to start sending data.
lengthThe number of bytes to send.
Returns
The number of bytes sent.

Implements XmobiTea.ProtonNetServer.ISession.

◆ SendAsync() [1/2]

virtual bool XmobiTea.ProtonNetServer.SslSession.SendAsync ( byte[] buffer)
virtual

Asynchronously sends data to the connected client.

Parameters
bufferThe data buffer to send.
Returns
True if the send operation is successfully initiated; otherwise, false.

Implements XmobiTea.ProtonNetServer.ISession.

Reimplemented in XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWssSession.

◆ SendAsync() [2/2]

virtual bool XmobiTea.ProtonNetServer.SslSession.SendAsync ( byte[] buffer,
int position,
int length )
virtual

Asynchronously sends data to the connected client.

Parameters
bufferThe data buffer to send.
positionThe position in the buffer at which to start sending data.
lengthThe number of bytes to send.
Returns
True if the send operation is successfully initiated; otherwise, false.

Implements XmobiTea.ProtonNetServer.ISession.


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