点击或拖拽改变大小

NetworkBaseWriteStreamFromSocketAsync 方法

从套接字中接收所有的数据然后写入到指定的流当中去,需要指定数据的长度,支持按照百分比进行进度报告
Receives all data from the socket and writes it to the specified stream. The length of the data needs to be specified, and progress reporting is supported in percentage.

命名空间:  HslCommunication.Core.Net
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
protected Task<OperateResult> WriteStreamFromSocketAsync(
	Socket socket,
	Stream stream,
	long totalLength,
	Action<long, long> report,
	bool reportByPercent
)

参数

socket
类型:System.Net.SocketsSocket
套接字
stream
类型:System.IOStream
数据流
totalLength
类型:SystemInt64
所有数据的长度
report
类型:SystemActionInt64, Int64
进度报告
reportByPercent
类型:SystemBoolean
进度报告是否按照百分比

返回值

类型:TaskOperateResult
是否成功的结果对象
参见