public class NetComplexClient extends NetworkXBase
| 限定符和类型 | 字段和说明 |
|---|---|
ActionOperateExThree<NetComplexClient,NetHandle,byte[]> |
AcceptByte
当接收到字节数据的时候,触发此事件
|
ActionOperateExThree<NetComplexClient,NetHandle,String> |
AcceptString
当接收到文本数据的时候,触发此事件
|
ActionOperate |
BeforReConnected
在客户端断开后并在重连服务器之前触发,用于清理系统资源,参数无意义
|
ActionOperateExOne<Integer> |
LoginFailed
连接失败时触发的事件,参数为连接失败的次数
|
ActionOperate |
LoginSuccess
客户端启动成功的事件,重连成功也将触发此事件,参数没有意义
|
ActionOperateExOne<String> |
MessageAlerts
服务器的异常,启动,等等一般消息产生的时候,出发此事件
|
threadCoreSocket, fileCacheSize, LogNet, Token| 构造器和说明 |
|---|
NetComplexClient()
实例化一个对象
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
ClientClose()
关闭该客户端引擎
|
void |
ClientStart()
启动客户端引擎,连接服务器系统
|
protected void |
DataProcessingCenter(AppSession session,
int protocol,
int customer,
byte[] content)
客户端的数据处理中心
|
String |
getClientAlias()
获取客户端的登录标识名
|
int |
getConnectFailedCount()
获取失败重连次数
|
int |
getDelayTime()
获取信息延迟的时间
|
String |
getIpAddress()
获取IP地址
|
boolean |
getIsClientStart()
获取客户端是否启动
|
int |
getPort()
获取端口号
|
void |
Send(NetHandle customer,
byte[] bytes)
服务器端用于发送字节的方法
|
void |
Send(NetHandle customer,
String str)
服务器端用于数据发送文本的方法
|
void |
setClientAlias(String clientAlias)
设置客户端的登录标识名
|
void |
setClientStart(boolean clientStart)
设置客户端是否启动
|
void |
setIpAddress(String ipAddress)
设置Ip地址
|
void |
setPort(int port)
设置端口号
|
protected void |
SocketReceiveException(AppSession receive)
通信出错后的处理
|
String |
toString()
返回对象的字符串表示形式
|
AppSessionRemoteClose, BeginReceiveBackground, DeleteFileByName, PreprocessFolderName, SendFileStreamToSocketCheckRemoteToken, CloseSocket, CreateSocketAndConnect, CreateSocketAndConnect, CreateSocketAndConnect, ReadStream, Receive, Receive, Receive, ReceiveAndCheckBytes, ReceiveByMessage, ReceiveByMessage, ReceiveBytesContentFromSocket, ReceiveBytesContentFromSocket, ReceiveCommandLineFromSocket, ReceiveCommandLineFromSocket, ReceiveCommandLineFromSocket, ReceiveCommandLineFromSocket, ReceiveFrameWebSocketPayload, ReceiveHslMessage, ReceiveMqttMessage, ReceiveRedisCommand, ReceiveRedisCommandString, ReceiveStringArrayContentFromSocket, ReceiveStringArrayContentFromSocket, ReceiveStringContentFromSocket, ReceiveStringContentFromSocket, ReceiveWebSocketPayload, Send, Send, SendAccountAndCheckReceive, SendBaseAndCheckReceive, SendBytesAndCheckReceive, SendStreamToSocket, SendStringAndCheckReceive, SendStringAndCheckReceive, ThreadPoolCheckTimeOut, WriteStream, WriteStreamFromSocketpublic ActionOperate LoginSuccess
public ActionOperateExOne<Integer> LoginFailed
public ActionOperateExOne<String> MessageAlerts
public ActionOperate BeforReConnected
public ActionOperateExThree<NetComplexClient,NetHandle,String> AcceptString
public ActionOperateExThree<NetComplexClient,NetHandle,byte[]> AcceptByte
public String getIpAddress()
public void setIpAddress(String ipAddress)
ipAddress - Ip地址public int getPort()
public void setPort(int port)
port - public boolean getIsClientStart()
public void setClientStart(boolean clientStart)
clientStart - 客户端是否启动public int getConnectFailedCount()
public String getClientAlias()
public void setClientAlias(String clientAlias)
clientAlias - public int getDelayTime()
public void ClientClose()
public void ClientStart()
protected void SocketReceiveException(AppSession receive)
SocketReceiveException 在类中 NetworkXBasereceive - 通信方法public void Send(NetHandle customer, String str)
customer - 用户自定义的命令头str - 发送的文本public void Send(NetHandle customer, byte[] bytes)
customer - 用户自定义的命令头bytes - 实际发送的数据protected void DataProcessingCenter(AppSession session, int protocol, int customer, byte[] content)
DataProcessingCenter 在类中 NetworkXBasesession - 连接状态protocol - 协议头customer - 用户自定义content - 数据内容public String toString()
toString 在类中 NetworkXBaseCopyright © 2022. All rights reserved.