ProtonNet Server 1.0
An Open Solution for all your socket or web api needs.
|
Interface representing a socket client peer, which is responsible for managing socket connections, sending events, and handling callbacks for various socket events. More...
Public Member Functions | |
ISocketClient | GetSocketClient () |
Retrieves the underlying socket client associated with this peer. | |
void | Send (OperationEvent operationEvent, SendParameters sendParameters=default) |
Sends an operation event to the server. | |
bool | Connect (bool autoReconnect=false, OnConnected onConnected=null, OnDisconnected onDisconnected=null) |
Establishes a connection to the server. | |
bool | Reconnect (bool autoReconnect=false, OnConnected onConnected=null, OnDisconnected onDisconnected=null) |
Reconnects to the server. | |
bool | Disconnect () |
Disconnects from the server. | |
bool | IsConnected () |
Checks if the client peer is currently connected to the server. | |
Public Member Functions inherited from XmobiTea.ProtonNet.Client.IClientPeer | |
int | GetClientId () |
Gets the unique client ID. | |
int | GetPing () |
Gets the current ping (round-trip time) to the server. | |
int | GetSendRate () |
Gets the rate at which data is sent by this client peer. | |
INetworkStatistics | GetNetworkStatistics () |
Gets the network statistics associated with this client peer. | |
void | Send (OperationRequest operationRequest, Action< OperationResponse > onResponse=null, SendParameters sendParameters=default, int timeoutInSeconds=15) |
Sends an operation request to the server with an optional callback for the response. | |
Task< OperationResponse > | SendAsync (OperationRequest operationRequest, SendParameters sendParameters=default, int timeoutInSeconds=15) |
Asynchronously sends an operation request to the server. | |
void | Service () |
Services the client peer, processing any pending tasks or requests. | |
void | SetDebugSupport (IDebugSupport debugSupport) |
Sets the debug support for this client peer. | |
void | SetAuthToken (string authToken) |
Sets the authentication token for this client peer. | |
void | SetSendRate (int sendRate) |
Sets the rate at which data is sent by this client peer. | |
Properties | |
OnConnected | OnConnected [get, set] |
Event triggered when a connection is successfully established. | |
OnDisconnected | OnDisconnected [get, set] |
Event triggered when a disconnection occurs. | |
OnOperationEvent | OnOperationEvent [get, set] |
Event triggered when an operation event is received. | |
OnError | OnError [get, set] |
Event triggered when a socket error occurs. | |
Interface representing a socket client peer, which is responsible for managing socket connections, sending events, and handling callbacks for various socket events.
bool XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.Connect | ( | bool | autoReconnect = false, |
OnConnected | onConnected = null, | ||
OnDisconnected | onDisconnected = null ) |
Establishes a connection to the server.
autoReconnect | Specifies whether to automatically reconnect if the connection is lost. |
onConnected | Callback for handling successful connections. |
onDisconnected | Callback for handling disconnections. |
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.
bool XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.Disconnect | ( | ) |
Disconnects from the server.
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.
ISocketClient XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.GetSocketClient | ( | ) |
Retrieves the underlying socket client associated with this peer.
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.
bool XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.IsConnected | ( | ) |
Checks if the client peer is currently connected to the server.
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.
bool XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.Reconnect | ( | bool | autoReconnect = false, |
OnConnected | onConnected = null, | ||
OnDisconnected | onDisconnected = null ) |
Reconnects to the server.
autoReconnect | Specifies whether to automatically reconnect if the connection is lost. |
onConnected | Callback for handling successful connections. |
onDisconnected | Callback for handling disconnections. |
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.
void XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.Send | ( | OperationEvent | operationEvent, |
SendParameters | sendParameters = default ) |
Sends an operation event to the server.
operationEvent | The operation event to send. |
sendParameters | Optional parameters for sending the event. |
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.
|
getset |
Event triggered when a connection is successfully established.
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.
|
getset |
Event triggered when a disconnection occurs.
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.
|
getset |
Event triggered when a socket error occurs.
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.
|
getset |
Event triggered when an operation event is received.
Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.