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

Represents the interface for a session, providing methods for managing the connection, sending data, and retrieving network statistics. More...

Inheritance diagram for XmobiTea.ProtonNetServer.ISession:
XmobiTea.ProtonNetServer.IHttpSession XmobiTea.ProtonNetServer.ITcpSession XmobiTea.ProtonNetServer.IUdpSession XmobiTea.ProtonNetServer.IWsSession XmobiTea.ProtonNetServer.HttpSession XmobiTea.ProtonNetServer.HttpsSession XmobiTea.ProtonNetServer.SslSession XmobiTea.ProtonNetServer.TcpSession XmobiTea.ProtonNetServer.UdpSession XmobiTea.ProtonNetServer.WsSession XmobiTea.ProtonNetServer.WssSession XmobiTea.ProtonNet.Server.WebApi.Sessions.WebApiHttpSession XmobiTea.ProtonNetServer.WsSession XmobiTea.ProtonNet.Server.WebApi.Sessions.WebApiHttpsSession XmobiTea.ProtonNetServer.WssSession XmobiTea.ProtonNet.Server.Socket.Sessions.SocketSslSession XmobiTea.ProtonNetServer.HttpsSession XmobiTea.ProtonNet.Server.Socket.Sessions.SocketTcpSession XmobiTea.ProtonNetServer.HttpSession XmobiTea.ProtonNet.Server.Socket.Sessions.SocketUdpSession XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWsSession XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWssSession

Public Member Functions

bool Disconnect ()
 Disconnects the session.
 
int Send (byte[] buffer)
 Sends data synchronously to the connected client.
 
int Send (byte[] buffer, int position, int length)
 Sends data synchronously to the connected client with a specified position and length.
 
bool SendAsync (byte[] buffer)
 Sends data asynchronously to the connected client.
 
bool SendAsync (byte[] buffer, int position, int length)
 Sends data asynchronously to the connected client with a specified position and length.
 
INetworkStatistics GetNetworkStatistics ()
 Gets the network statistics for the session.
 

Detailed Description

Represents the interface for a session, providing methods for managing the connection, sending data, and retrieving network statistics.

Member Function Documentation

◆ Disconnect()

bool XmobiTea.ProtonNetServer.ISession.Disconnect ( )

Disconnects the session.

Returns
True if the session was disconnected successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.SslSession, XmobiTea.ProtonNetServer.TcpSession, and XmobiTea.ProtonNetServer.UdpSession.

◆ GetNetworkStatistics()

INetworkStatistics XmobiTea.ProtonNetServer.ISession.GetNetworkStatistics ( )

Gets the network statistics for the session.

Returns
An instance of INetworkStatistics representing the network statistics.

Implemented in XmobiTea.ProtonNetServer.SslSession, XmobiTea.ProtonNetServer.TcpSession, and XmobiTea.ProtonNetServer.UdpSession.

◆ Send() [1/2]

int XmobiTea.ProtonNetServer.ISession.Send ( byte[] buffer)

Sends data synchronously to the connected client.

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

Implemented in XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWsSession, XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWssSession, XmobiTea.ProtonNetServer.SslSession, XmobiTea.ProtonNetServer.TcpSession, and XmobiTea.ProtonNetServer.UdpSession.

◆ Send() [2/2]

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

Sends data synchronously to the connected client with a specified position and length.

Parameters
bufferThe data buffer to send.
positionThe starting position in the buffer.
lengthThe length of the data to send.
Returns
The number of bytes sent.

Implemented in XmobiTea.ProtonNetServer.SslSession, XmobiTea.ProtonNetServer.TcpSession, and XmobiTea.ProtonNetServer.UdpSession.

◆ SendAsync() [1/2]

bool XmobiTea.ProtonNetServer.ISession.SendAsync ( byte[] buffer)

Sends data asynchronously to the connected client.

Parameters
bufferThe data buffer to send.
Returns
True if the data was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWsSession, XmobiTea.ProtonNet.Server.Socket.Sessions.SocketWssSession, XmobiTea.ProtonNetServer.SslSession, XmobiTea.ProtonNetServer.TcpSession, and XmobiTea.ProtonNetServer.UdpSession.

◆ SendAsync() [2/2]

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

Sends data asynchronously to the connected client with a specified position and length.

Parameters
bufferThe data buffer to send.
positionThe starting position in the buffer.
lengthThe length of the data to send.
Returns
True if the data was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.SslSession, XmobiTea.ProtonNetServer.TcpSession, and XmobiTea.ProtonNetServer.UdpSession.


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