MqttHelperSendMqttFile 方法 (CommunicationPipe, Stream, String, String, ActionInt64, Int64, AesCryptography, HslCancelToken) |
使用MQTT协议将一个数据流发送到网络上去,需要保存的文件名,可选指定文件描述信息,进度报告
Use the MQTT protocol to send a data stream to the network, the file name that needs to be saved, optional file description information, progress report
命名空间:
HslCommunication.MQTT
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static OperateResult SendMqttFile(
CommunicationPipe pipe,
Stream stream,
string servername,
string filetag,
Action<long, long> reportProgress = null,
AesCryptography aesCryptography = null,
HslCancelToken cancelToken = null
)
Public Shared Function SendMqttFile (
pipe As CommunicationPipe,
stream As Stream,
servername As String,
filetag As String,
Optional reportProgress As Action(Of Long, Long) = Nothing,
Optional aesCryptography As AesCryptography = Nothing,
Optional cancelToken As HslCancelToken = Nothing
) As OperateResult
public:
static OperateResult^ SendMqttFile(
CommunicationPipe^ pipe,
Stream^ stream,
String^ servername,
String^ filetag,
Action<long long, long long>^ reportProgress = nullptr,
AesCryptography^ aesCryptography = nullptr,
HslCancelToken^ cancelToken = nullptr
)
static member SendMqttFile :
pipe : CommunicationPipe *
stream : Stream *
servername : string *
filetag : string *
?reportProgress : Action<int64, int64> *
?aesCryptography : AesCryptography *
?cancelToken : HslCancelToken
(* Defaults:
let _reportProgress = defaultArg reportProgress null
let _aesCryptography = defaultArg aesCryptography null
let _cancelToken = defaultArg cancelToken null
*)
-> OperateResult
参数
- pipe
- 类型:HslCommunication.Core.PipeCommunicationPipe
当前的管道对象信息 - stream
- 类型:System.IOStream
数据流 - servername
- 类型:SystemString
对方接收后保存的文件名 - filetag
- 类型:SystemString
文件的描述信息 - reportProgress (Optional)
- 类型:SystemActionInt64, Int64
进度报告,第一个参数是已完成的字节数量,第二个参数是总字节数量。 - aesCryptography (Optional)
- 类型:HslCommunication.Core.SecurityAesCryptography
AES数据加密对象,如果为空,则不进行加密 - cancelToken (Optional)
- 类型:HslCommunication.CoreHslCancelToken
用户取消的令牌信息
返回值
类型:
OperateResult是否操作成功
参见