TCPClientNetwork 类
继承成员
命名空间: Fantasy.Network.TCP
程序集: Fantasy.Net.dll
语法
public sealed class TCPClientNetwork : AClientNetwork, IEntity, IPool, INetworkChannel, IDisposable
属性
| 编辑本文 查看源代码ChannelId
声明
public uint ChannelId { get; }
属性值
类型 | 描述 |
---|---|
uint |
方法
| 编辑本文 查看源代码Connect(string, Action, Action, Action, bool, int)
连接到远程服务器。
声明
public override Session Connect(string remoteAddress, Action onConnectComplete, Action onConnectFail, Action onConnectDisconnect, bool isHttps, int connectTimeout = 5000)
参数
类型 | 名称 | 描述 |
---|---|---|
string | remoteAddress | 远程服务器的终端点。 |
Action | onConnectComplete | 连接成功时的回调。 |
Action | onConnectFail | 连接失败时的回调。 |
Action | onConnectDisconnect | 连接断开时的回调。 |
bool | isHttps | |
int | connectTimeout | 连接超时时间,单位:毫秒。 |
返回
类型 | 描述 |
---|---|
Session | 连接的会话。 |
重写
| 编辑本文 查看源代码Dispose()
销毁当前实体,销毁后会自动销毁当前实体下的所有实体。
声明
public override void Dispose()
重写
| 编辑本文 查看源代码Initialize(NetworkTarget)
声明
public void Initialize(NetworkTarget networkTarget)
参数
类型 | 名称 | 描述 |
---|---|---|
NetworkTarget | networkTarget |
RemoveChannel(uint)
声明
public override void RemoveChannel(uint channelId)
参数
类型 | 名称 | 描述 |
---|---|---|
uint | channelId |
重写
| 编辑本文 查看源代码Send(uint, long, MemoryStreamBuffer, IMessage)
声明
public override void Send(uint rpcId, long routeId, MemoryStreamBuffer memoryStream, IMessage message)
参数
类型 | 名称 | 描述 |
---|---|---|
uint | rpcId | |
long | routeId | |
MemoryStreamBuffer | memoryStream | |
IMessage | message |