| 程序包 | 说明 |
|---|---|
| HslCommunication.Core.Net | |
| HslCommunication.Core.Net.NetworkBase | |
| HslCommunication.Enthernet.PushNet | |
| HslCommunication.MQTT |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
NetSupport.ReadBytesFromSocket(Socket socket,
int receive,
ActionOperateExTwo<Long,Long> reportProgress)
从socket的网络中读取数据内容,需要指定数据长度和超时的时间,为了防止数据太大导致接收失败,所以此处接收到新的数据之后就更新时间。
|
| 限定符和类型 | 字段和说明 |
|---|---|
ActionOperateExTwo |
NetworkDataServerBase.OnDataReceived
接收到数据的时候就触发的事件,示例详细参考API文档信息
An event that is triggered when data is received |
ActionOperateExTwo |
NetworkDataServerBase.OnDataSend
数据发送的时候就触发的事件
Events that are triggered when data is sent |
| 限定符和类型 | 方法和说明 |
|---|---|
protected OperateResultExOne<byte[]> |
NetworkBase.Receive(Socket socket,
int length,
int timeout,
ActionOperateExTwo<Long,Long> reportProgress)
接收固定长度的字节数组,需要指定超时时间,当length大于0时,接收固定长度的数据内容,当length小于0时,接收不大于1024长度的随机数据信息
To receive a fixed-length byte array, you need to specify the timeout period. |
protected OperateResultExOne<byte[]> |
NetworkBase.ReceiveByMessage(Socket socket,
int timeOut,
INetMessage netMessage,
ActionOperateExTwo<Long,Long> reportProgress)
接收一条完整的
INetMessage 数据内容,需要指定超时时间,单位为毫秒。 |
protected OperateResultExTwo<Byte,byte[]> |
NetworkBase.ReceiveMqttMessage(Socket socket,
int timeOut,
ActionOperateExTwo<Long,Long> reportProgress)
接收一条完成的MQTT协议的报文信息,包含控制码和负载数据
Receive a message of a completed MQTT protocol, including control code and payload data |
protected OperateResult |
NetworkXBase.SendFileStreamToSocket(Socket socket,
String filename,
long fileLength,
ActionOperateExTwo<Long,Long> report)
[自校验] 将文件数据发送至套接字,如果结果异常,则结束通讯
[Self-check] Send the file data to the socket. |
protected OperateResult |
NetworkBase.SendStreamToSocket(Socket socket,
InputStream stream,
long receive,
ActionOperateExTwo<Long,Long> report,
boolean reportByPercent)
发送一个流的所有数据到指定的网络套接字,需要指定发送的数据长度,支持按照百分比的进度报告
Send all the data of a stream to the specified network socket. |
protected OperateResult |
NetworkBase.WriteStreamFromSocket(Socket socket,
OutputStream stream,
long totalLength,
ActionOperateExTwo<Long,Long> report,
boolean reportByPercent)
从套接字中接收所有的数据然后写入到指定的流当中去,需要指定数据的长度,支持按照百分比进行进度报告
Receives all data from the socket and writes it to the specified stream. |
| 限定符和类型 | 方法和说明 |
|---|---|
OperateResult |
NetPushClient.CreatePush(ActionOperateExTwo<NetPushClient,String> pushCallBack)
创建数据推送服务
|
| 限定符和类型 | 方法和说明 |
|---|---|
OperateResultExTwo<String,byte[]> |
MqttSyncClient.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 |
OperateResultExTwo<String,byte[]> |
MqttSyncClient.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 |
OperateResultExTwo<String,byte[]> |
MqttSyncClient.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 |
OperateResultExTwo<String,String> |
MqttSyncClient.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 |
OperateResultExTwo<String,String> |
MqttSyncClient.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 |
OperateResultExTwo<String,String> |
MqttSyncClient.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 |
Copyright © 2022. All rights reserved.