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

Interface representing a socket client peer, which is responsible for managing socket connections, sending events, and handling callbacks for various socket events. More...

Inheritance diagram for XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer:
XmobiTea.ProtonNet.Client.IClientPeer XmobiTea.ProtonNet.Client.Socket.SocketClientPeer

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< OperationResponseSendAsync (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.
 

Detailed Description

Interface representing a socket client peer, which is responsible for managing socket connections, sending events, and handling callbacks for various socket events.

Member Function Documentation

◆ Connect()

bool XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.Connect ( bool autoReconnect = false,
OnConnected onConnected = null,
OnDisconnected onDisconnected = null )

Establishes a connection to the server.

Parameters
autoReconnectSpecifies whether to automatically reconnect if the connection is lost.
onConnectedCallback for handling successful connections.
onDisconnectedCallback for handling disconnections.
Returns
True if the connection was successfully established, otherwise false.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.

◆ Disconnect()

bool XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.Disconnect ( )

Disconnects from the server.

Returns
True if the disconnection was successful, otherwise false.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.

◆ GetSocketClient()

ISocketClient XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.GetSocketClient ( )

Retrieves the underlying socket client associated with this peer.

Returns
An instance of ISocketClient representing the socket client.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.

◆ IsConnected()

bool XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.IsConnected ( )

Checks if the client peer is currently connected to the server.

Returns
True if connected, otherwise false.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.

◆ Reconnect()

bool XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.Reconnect ( bool autoReconnect = false,
OnConnected onConnected = null,
OnDisconnected onDisconnected = null )

Reconnects to the server.

Parameters
autoReconnectSpecifies whether to automatically reconnect if the connection is lost.
onConnectedCallback for handling successful connections.
onDisconnectedCallback for handling disconnections.
Returns
True if the reconnection was successful, otherwise false.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.

◆ Send()

void XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.Send ( OperationEvent operationEvent,
SendParameters sendParameters = default )

Sends an operation event to the server.

Parameters
operationEventThe operation event to send.
sendParametersOptional parameters for sending the event.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.

Property Documentation

◆ OnConnected

OnConnected XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.OnConnected
getset

Event triggered when a connection is successfully established.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.

◆ OnDisconnected

OnDisconnected XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.OnDisconnected
getset

Event triggered when a disconnection occurs.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.

◆ OnError

OnError XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.OnError
getset

Event triggered when a socket error occurs.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.

◆ OnOperationEvent

OnOperationEvent XmobiTea.ProtonNet.Client.Socket.ISocketClientPeer.OnOperationEvent
getset

Event triggered when an operation event is received.

Implemented in XmobiTea.ProtonNet.Client.Socket.SocketClientPeer.


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