public class MqttSyncClient extends NetworkDoubleBase
AlienSession, isPersistentConn, IsSocketError, isUseAccountCertificate, LogMsgFormatBinary, simpleHybirdLockCoreSocket, fileCacheSize, LogNet, Token| 构造器和说明 |
|---|
MqttSyncClient(MqttConnectionOptions options)
实例化一个MQTT的同步客户端
Instantiate an MQTT synchronization client |
MqttSyncClient(String ipAddress,
int port)
通过指定的ip地址及端口来实例化一个同步的MQTT客户端
Instantiate a synchronized MQTT client with the specified IP address and port |
| 限定符和类型 | 方法和说明 |
|---|---|
MqttConnectionOptions |
getConnectionOptions() |
String |
getStringEncoding()
获取使用字符串访问的时候,使用的编码信息,默认为UT8编码
Get the encoding information used when accessing with a string, the default is UT8 encoding
|
protected OperateResult |
InitializationOnConnect(Socket socket)
根据实际的协议选择是否重写本方法,有些协议在创建连接之后,需要进行一些初始化的信号握手,才能最终建立网络通道。
|
OperateResultExTwo<String,byte[]> |
Read(String topic,
byte[] payload)
从MQTT服务器同步读取数据,将payload发送到服务器,然后从服务器返回相关的数据
Synchronously read data from the MQTT server, send the payload to the server, and then return relevant data from the server |
OperateResultExTwo<String,byte[]> |
Read(String topic,
byte[] payload,
ActionOperateExTwo<Long,Long> sendProgress,
ActionOperateExTwo<String,String> handleProgress,
ActionOperateExTwo<Long,Long> receiveProgress)
从MQTT服务器同步读取数据,将payload发送到服务器,然后从服务器返回相关的数据,支持数据发送进度报告,服务器执行进度报告,接收数据进度报告操作
Synchronously read data from the MQTT server, send the payload to the server, and then return relevant data from the server, support data transmission progress report, the server executes the progress report, and receives the data progress report |
OperateResultExOne<byte[]> |
ReadFromCoreServer(Socket socket,
byte[] send) |
OperateResultExOne<String[]> |
ReadRetainTopics()
读取服务器的已经驻留的所有消息的主题列表
Read the topic list of all messages that have resided on the server |
OperateResultExOne<String> |
ReadRpcApis()
读取服务器的已经注册的API信息列表,将返回API的主题路径,注释信息,示例的传入的数据信息。
|
OperateResultExTwo<String,String> |
ReadString(String topic,
String payload,
ActionOperateExTwo<Long,Long> sendProgress,
ActionOperateExTwo<String,String> handleProgress,
ActionOperateExTwo<Long,Long> receiveProgress)
从MQTT服务器同步读取数据,将指定编码的字符串payload发送到服务器,然后从服务器返回相关的数据,并转换为指定编码的字符串,支持数据发送进度报告,服务器执行进度报告,接收数据进度报告操作
Synchronously read data from the MQTT server, send the specified encoded string payload to the server, and then return the data from the server, and convert it to the specified encoded string, support data transmission progress report, the server executes the progress report, and receives the data progress report |
void |
setConnectionOptions(MqttConnectionOptions connectionOptions) |
void |
setStringEncoding(String stringEncoding) |
String |
toString()
返回当前对象表示的字符串
Returns the string represented by the current object |
AccountCertificate, ConnectClose, ConnectServer, ConnectServer, ExtraAfterReadFromCoreServer, ExtraOnDisconnect, GetAvailableSocket, getByteTransform, getConnectionId, getConnectTimeOut, getIpAddress, GetNewNetMessage, getPort, getReceiveTimeOut, getSleepTime, IpAddressPing, PackCommandWithHeader, ReadFromCoreServer, ReadFromCoreServer, ReadFromCoreServer, setByteTransform, setConnectionId, setConnectTimeOut, setIpAddress, SetLoginAccount, SetPersistentConnection, setPort, setReceiveTimeOut, setSleepTime, UnpackResponseContentCheckRemoteToken, 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 MqttSyncClient(MqttConnectionOptions options)
options - 连接的配置信息public MqttSyncClient(String ipAddress, int port)
ipAddress - IP地址信息port - 端口号信息protected OperateResult InitializationOnConnect(Socket socket)
NetworkDoubleBaseInitializationOnConnect 在类中 NetworkDoubleBasesocket - 网络套接字public OperateResultExOne<byte[]> ReadFromCoreServer(Socket socket, byte[] send)
public OperateResultExTwo<String,byte[]> Read(String topic, byte[] payload, ActionOperateExTwo<Long,Long> sendProgress, ActionOperateExTwo<String,String> handleProgress, ActionOperateExTwo<Long,Long> receiveProgress)
topic - 主题信息payload - 负载数据sendProgress - 发送数据给服务器时的进度报告,第一个参数为已发送数据,第二个参数为总发送数据handleProgress - 服务器处理数据的进度报告,第一个参数Topic自定义,通常用来传送操作百分比,第二个参数自定义,通常用来表示服务器消息receiveProgress - 从服务器接收数据的进度报告,第一个参数为已接收数据,第二个参数为总接收数据public OperateResultExTwo<String,byte[]> Read(String topic, byte[] payload)
topic - 主题信息payload - 负载数据public OperateResultExTwo<String,String> ReadString(String topic, String payload, ActionOperateExTwo<Long,Long> sendProgress, ActionOperateExTwo<String,String> handleProgress, ActionOperateExTwo<Long,Long> receiveProgress)
topic - 主题信息payload - 负载数据sendProgress - 发送数据给服务器时的进度报告,第一个参数为已发送数据,第二个参数为总发送数据handleProgress - 服务器处理数据的进度报告,第一个参数Topic自定义,通常用来传送操作百分比,第二个参数自定义,通常用来表示服务器消息receiveProgress - 从服务器接收数据的进度报告,第一个参数为已接收数据,第二个参数为总接收数据public OperateResultExOne<String> ReadRpcApis()
public OperateResultExOne<String[]> ReadRetainTopics()
public MqttConnectionOptions getConnectionOptions()
public void setConnectionOptions(MqttConnectionOptions connectionOptions)
public String getStringEncoding()
public void setStringEncoding(String stringEncoding)
public String toString()
NetworkBasetoString 在类中 NetworkDoubleBaseCopyright © 2022. All rights reserved.