C# Class Pdelvo.Minecraft.Proxy.Library.Connection.ProxyConnection

The basic implementation of the IProxyConnection interface
Inheritance: IProxyConnection
Mostrar archivo Open project: pdelvo/Pdelvo.Minecraft.Proxy Class Usage Examples

Public Methods

Method Description
CloseAsync ( ) : System.Threading.Tasks.Task

Asynchronously close this connection

Dispose ( ) : void

Cleans all resources of this connection

InitializeServerAsync ( RemoteServerInfo serverEndPoint ) : Task

Asynchronously initialize the server side of this connection

KickUserAsync ( string message ) : System.Threading.Tasks.Task

Asyncronously kicking a client

ProxyConnection ( Socket networkSocket, ProxyServer server ) : System

Creates a new instance of the ProxyConnection class with the remote socket of the client and the ProxyServer this connection should belong to.

StartClientListening ( ) : void

Start waiting for client packets

StartServerListening ( ) : void

Start waiting for server packets

Private Methods

Method Description
ClientConnectionLost ( object sender, EventArgs e ) : void
ClientPacketReceived ( object sender, PacketReceivedEventArgs args ) : void
HandleClient ( ) : void
InitializeServerAsync ( ) : Task
OnConnectionLost ( ) : void
ServerConnectionLost ( object sender, EventArgs e ) : void
ServerPacketReceived ( object sender, PacketReceivedEventArgs args ) : void
UnregisterServer ( ) : void

Method Details

CloseAsync() public method

Asynchronously close this connection
public CloseAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

Dispose() public method

Cleans all resources of this connection
public Dispose ( ) : void
return void

InitializeServerAsync() public method

Asynchronously initialize the server side of this connection
public InitializeServerAsync ( RemoteServerInfo serverEndPoint ) : Task
serverEndPoint RemoteServerInfo Information of the new server this connection should connect to.
return Task

KickUserAsync() public method

Asyncronously kicking a client
public KickUserAsync ( string message ) : System.Threading.Tasks.Task
message string The kick message
return System.Threading.Tasks.Task

ProxyConnection() public method

Creates a new instance of the ProxyConnection class with the remote socket of the client and the ProxyServer this connection should belong to.
public ProxyConnection ( Socket networkSocket, ProxyServer server ) : System
networkSocket Socket The network socket of the network client
server ProxyServer The proxy server this connection belongs to
return System

StartClientListening() public method

Start waiting for client packets
public StartClientListening ( ) : void
return void

StartServerListening() public method

Start waiting for server packets
public StartServerListening ( ) : void
return void