C# Class LiteNetLib.NetClient

Inheritance: NetBase
Show file Open project: RevenantX/LiteNetLib Class Usage Examples

Public Properties

Property Type Description
MaxConnectAttempts int
PeerToPeerMode bool
ReconnectDelay int

Public Methods

Method Description
Connect ( NetEndPoint target ) : void
Connect ( string address, int port ) : void

Connect to NetServer or NetClient with PeerToPeerMode

Disconnect ( ) : void

Disconnect from NetServer

NetClient ( INetEventListener listener, string connectKey ) : System
Stop ( ) : void

Force closes connection and stop all threads.

Protected Methods

Method Description
PostProcessEvent ( int deltaTime ) : void
ProcessReceiveError ( int socketErrorCode ) : void
ReceiveFromSocket ( byte reusableBuffer, int count, NetEndPoint remoteEndPoint ) : void

Private Methods

Method Description
CloseConnection ( bool force, DisconnectReason reason, int socketErrorCode ) : void
ProcessConnectAccept ( ) : void
ProcessSendError ( NetEndPoint remoteEndPoint, int socketErrorCode ) : void
ReceiveFromPeer ( NetPacket packet, NetEndPoint remoteEndPoint ) : void
SendConnectRequest ( ) : void

Method Details

Connect() public method

public Connect ( NetEndPoint target ) : void
target NetEndPoint
return void

Connect() public method

Connect to NetServer or NetClient with PeerToPeerMode
public Connect ( string address, int port ) : void
address string Server IP or hostname
port int Server Port
return void

Disconnect() public method

Disconnect from NetServer
public Disconnect ( ) : void
return void

NetClient() public method

public NetClient ( INetEventListener listener, string connectKey ) : System
listener INetEventListener
connectKey string
return System

PostProcessEvent() protected method

protected PostProcessEvent ( int deltaTime ) : void
deltaTime int
return void

ProcessReceiveError() protected method

protected ProcessReceiveError ( int socketErrorCode ) : void
socketErrorCode int
return void

ReceiveFromSocket() protected method

protected ReceiveFromSocket ( byte reusableBuffer, int count, NetEndPoint remoteEndPoint ) : void
reusableBuffer byte
count int
remoteEndPoint NetEndPoint
return void

Stop() public method

Force closes connection and stop all threads.
public Stop ( ) : void
return void

Property Details

MaxConnectAttempts public property

public int MaxConnectAttempts
return int

PeerToPeerMode public property

public bool PeerToPeerMode
return bool

ReconnectDelay public property

public int ReconnectDelay
return int