C# Class GonzoNet.NetworkClient

Afficher le fichier Open project: RHY3756547/FreeSO Class Usage Examples

Protected Properties

Свойство Type Description
m_Listener Listener
m_LoginArgs GonzoNet.LoginArgsContainer

Méthodes publiques

Méthode Description
Connect ( GonzoNet.LoginArgsContainer LoginArgs ) : void

Connects to the login server.

Disconnect ( ) : void

Disconnects this NetworkClient instance and stops all sending and receiving of data.

GetPackets ( ) : Queue
NetworkClient ( Socket ClientSocket, Listener Server, EncryptionMode EMode ) : System

Initializes a client that listens for data.

NetworkClient ( string IP, int Port, EncryptionMode EMode, bool KeepAlive ) : System
ProcessPackets ( ) : void
Send ( byte Data ) : void
SendEncrypted ( byte PacketID, byte Data ) : void

Sends an encrypted packet to the server. Automatically appends the length of the packet after the ID, as the encrypted data can be smaller or longer than that of the unencrypted data.

Méthodes protégées

Méthode Description
OnSend ( IAsyncResult AR ) : void
ReceiveCallback ( IAsyncResult AR ) : void

Private Methods

Méthode Description
BeginReceive ( ) : void
ConnectCallback ( IAsyncResult AR ) : void
FindPacketHandler ( byte ID ) : GonzoNet.PacketHandler
OnPacket ( GonzoNet.ProcessedPacket packet, GonzoNet.PacketHandler handler ) : void

Method Details

Connect() public méthode

Connects to the login server.
public Connect ( GonzoNet.LoginArgsContainer LoginArgs ) : void
LoginArgs GonzoNet.LoginArgsContainer Arguments used for login. Can be null.
Résultat void

Disconnect() public méthode

Disconnects this NetworkClient instance and stops all sending and receiving of data.
public Disconnect ( ) : void
Résultat void

GetPackets() public méthode

public GetPackets ( ) : Queue
Résultat Queue

NetworkClient() public méthode

Initializes a client that listens for data.
public NetworkClient ( Socket ClientSocket, Listener Server, EncryptionMode EMode ) : System
ClientSocket Socket The client's socket.
Server Listener The Listener instance calling this constructor.
EMode EncryptionMode
Résultat System

NetworkClient() public méthode

public NetworkClient ( string IP, int Port, EncryptionMode EMode, bool KeepAlive ) : System
IP string
Port int
EMode EncryptionMode
KeepAlive bool
Résultat System

OnSend() protected méthode

protected OnSend ( IAsyncResult AR ) : void
AR IAsyncResult
Résultat void

ProcessPackets() public méthode

public ProcessPackets ( ) : void
Résultat void

ReceiveCallback() protected méthode

protected ReceiveCallback ( IAsyncResult AR ) : void
AR IAsyncResult
Résultat void

Send() public méthode

public Send ( byte Data ) : void
Data byte
Résultat void

SendEncrypted() public méthode

Sends an encrypted packet to the server. Automatically appends the length of the packet after the ID, as the encrypted data can be smaller or longer than that of the unencrypted data.
public SendEncrypted ( byte PacketID, byte Data ) : void
PacketID byte The ID of the packet (will remain unencrypted).
Data byte The data that will be encrypted.
Résultat void

Property Details

m_Listener protected_oe property

protected Listener,GonzoNet m_Listener
Résultat Listener

m_LoginArgs protected_oe property

protected LoginArgsContainer,GonzoNet m_LoginArgs
Résultat GonzoNet.LoginArgsContainer