C# Class GameCore.NetWork.CNetTCPWork

Inheritance: INetWork
Mostrar archivo Open project: recter/Unity-Net

Public Methods

Method Description
CNetTCPWork ( ) : System
Connect ( int id, string host, int port, INetworkMsgHandler listener ) : void

创建连接

Disconnect ( int id ) : void

断开连接

DisconnectAll ( ) : void

关闭所有连接

GetCurrentServerID ( ) : int
GetReadyToConnectSID ( ) : int
ReConnect ( ) : void

重连当前连接

SendMessage ( int nMessageID, Byte data, int id = -1 ) : bool
SetCurrentServerID ( int v ) : void
SetReadyToConnectSID ( int v ) : void
ToNetWorkString ( ) : string
Update ( ) : void

生命周期内每侦更新

Private Methods

Method Description
__Clear ( ) : void
__Update ( CNetTCPSocketConnect connect ) : void

Method Details

CNetTCPWork() public method

public CNetTCPWork ( ) : System
return System

Connect() public method

创建连接
public Connect ( int id, string host, int port, INetworkMsgHandler listener ) : void
id int
host string
port int
listener INetworkMsgHandler
return void

Disconnect() public method

断开连接
public Disconnect ( int id ) : void
id int
return void

DisconnectAll() public method

关闭所有连接
public DisconnectAll ( ) : void
return void

GetCurrentServerID() public method

public GetCurrentServerID ( ) : int
return int

GetReadyToConnectSID() public method

public GetReadyToConnectSID ( ) : int
return int

ReConnect() public method

重连当前连接
public ReConnect ( ) : void
return void

SendMessage() public method

public SendMessage ( int nMessageID, Byte data, int id = -1 ) : bool
nMessageID int
data Byte
id int
return bool

SetCurrentServerID() public method

public SetCurrentServerID ( int v ) : void
v int
return void

SetReadyToConnectSID() public method

public SetReadyToConnectSID ( int v ) : void
v int
return void

ToNetWorkString() public method

public ToNetWorkString ( ) : string
return string

Update() public method

生命周期内每侦更新
public Update ( ) : void
return void