Represents a UDP session that handles communication with a remote endpoint.
More...
|
| UdpSession (UdpServer server) |
| Initializes a new instance of the UdpSession class with the specified server.
|
|
INetworkStatistics | GetNetworkStatistics () |
| Gets the network statistics for the session.
|
|
virtual bool | Disconnect () |
| Disconnects the session.
|
|
int | Send (byte[] buffer) |
| Sends data synchronously to the remote endpoint.
|
|
int | Send (byte[] buffer, int position, int length) |
| Sends data synchronously to the remote endpoint with a specified position and length.
|
|
bool | SendAsync (byte[] buffer) |
| Sends data asynchronously to the remote endpoint.
|
|
bool | SendAsync (byte[] buffer, int position, int length) |
| Sends data asynchronously to the remote endpoint with a specified position and length.
|
|
void | Dispose () |
| Disposes the session and its resources.
|
|
|
virtual void | OnConnecting () |
| Called when the session is connecting. Override this method to add custom logic during connection.
|
|
virtual void | OnConnected () |
| Called after the session has connected successfully. Override this method to add custom logic after connection.
|
|
virtual void | OnDisconnecting () |
| Called when the session is disconnecting. Override this method to add custom logic during disconnection.
|
|
virtual void | OnDisconnected () |
| Called after the session has disconnected successfully. Override this method to add custom logic after disconnection.
|
|
virtual void | OnReceived (byte[] buffer, int position, int length) |
| Called when data is received from the remote endpoint. Override this method to process received data.
|
|
virtual void | OnSent (int sent) |
| Called after data has been sent to the remote endpoint. Override this method to add custom logic after sending data.
|
|
virtual void | OnError (SocketError error) |
| Called when a socket error occurs. Override this method to handle errors in a custom way.
|
|
virtual void | Dispose (bool disposingManagedResources) |
| Disposes the session, optionally releasing managed resources.
|
|
|
string | Id [get] |
| Gets the unique identifier for the session.
|
|
UdpServer | Server [get] |
| Gets the server associated with this session.
|
|
System.Net.EndPoint | RemoteEndPoint [get] |
| Gets the remote endpoint for this session.
|
|
bool | IsConnected [get] |
| Gets a value indicating whether the session is connected.
|
|
bool | IsDisposed [get] |
| Gets a value indicating whether the session is disposed.
|
|
Represents a UDP session that handles communication with a remote endpoint.
◆ UdpSession()
XmobiTea.ProtonNetServer.UdpSession.UdpSession |
( |
UdpServer | server | ) |
|
Initializes a new instance of the UdpSession class with the specified server.
- Parameters
-
server | The server associated with this session. |
◆ Disconnect()
virtual bool XmobiTea.ProtonNetServer.UdpSession.Disconnect |
( |
| ) |
|
|
virtual |
◆ Dispose()
virtual void XmobiTea.ProtonNetServer.UdpSession.Dispose |
( |
bool | disposingManagedResources | ) |
|
|
protectedvirtual |
◆ GetNetworkStatistics()
Gets the network statistics for the session.
- Returns
- An instance of INetworkStatistics representing the network statistics.
Implements XmobiTea.ProtonNetServer.ISession.
◆ OnConnected()
virtual void XmobiTea.ProtonNetServer.UdpSession.OnConnected |
( |
| ) |
|
|
protectedvirtual |
◆ OnDisconnected()
virtual void XmobiTea.ProtonNetServer.UdpSession.OnDisconnected |
( |
| ) |
|
|
protectedvirtual |
◆ OnError()
virtual void XmobiTea.ProtonNetServer.UdpSession.OnError |
( |
SocketError | error | ) |
|
|
protectedvirtual |
Called when a socket error occurs. Override this method to handle errors in a custom way.
- Parameters
-
error | The SocketError that occurred. |
◆ OnReceived()
virtual void XmobiTea.ProtonNetServer.UdpSession.OnReceived |
( |
byte[] | buffer, |
|
|
int | position, |
|
|
int | length ) |
|
protectedvirtual |
Called when data is received from the remote endpoint. Override this method to process received data.
- Parameters
-
buffer | The received data buffer. |
position | The starting position in the buffer. |
length | The length of the received data. |
Reimplemented in XmobiTea.ProtonNet.Server.Socket.Sessions.SocketUdpSession.
◆ OnSent()
virtual void XmobiTea.ProtonNetServer.UdpSession.OnSent |
( |
int | sent | ) |
|
|
protectedvirtual |
Called after data has been sent to the remote endpoint. Override this method to add custom logic after sending data.
- Parameters
-
sent | The number of bytes sent. |
◆ Send() [1/2]
int XmobiTea.ProtonNetServer.UdpSession.Send |
( |
byte[] | buffer | ) |
|
Sends data synchronously to the remote endpoint.
- Parameters
-
buffer | The data buffer to send. |
- Returns
- The number of bytes sent.
Implements XmobiTea.ProtonNetServer.ISession.
◆ Send() [2/2]
int XmobiTea.ProtonNetServer.UdpSession.Send |
( |
byte[] | buffer, |
|
|
int | position, |
|
|
int | length ) |
Sends data synchronously to the remote endpoint with a specified position and length.
- Parameters
-
buffer | The data buffer to send. |
position | The starting position in the buffer. |
length | The length of the data to send. |
- Returns
- The number of bytes sent.
Implements XmobiTea.ProtonNetServer.ISession.
◆ SendAsync() [1/2]
bool XmobiTea.ProtonNetServer.UdpSession.SendAsync |
( |
byte[] | buffer | ) |
|
Sends data asynchronously to the remote endpoint.
- Parameters
-
buffer | The data buffer to send. |
- Returns
- True if the data was sent successfully; otherwise, false.
Implements XmobiTea.ProtonNetServer.ISession.
◆ SendAsync() [2/2]
bool XmobiTea.ProtonNetServer.UdpSession.SendAsync |
( |
byte[] | buffer, |
|
|
int | position, |
|
|
int | length ) |
Sends data asynchronously to the remote endpoint with a specified position and length.
- Parameters
-
buffer | The data buffer to send. |
position | The starting position in the buffer. |
length | The length of the data to send. |
- Returns
- True if the data was sent successfully; otherwise, false.
Implements XmobiTea.ProtonNetServer.ISession.
The documentation for this class was generated from the following file:
- XmobiTea.ProtonNetServer/IUdpSession.cs