NetworkBaseWriteStreamFromSocket 方法 |
从套接字中接收所有的数据然后写入到指定的流当中去,需要指定数据的长度,支持按照百分比进行进度报告
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 中) 版本:12.1.2.0 (12.1.2.0)
语法 protected OperateResult WriteStreamFromSocket(
Socket socket,
Stream stream,
long totalLength,
Action<long, long> report,
bool reportByPercent
)
Protected Function WriteStreamFromSocket (
socket As Socket,
stream As Stream,
totalLength As Long,
report As Action(Of Long, Long),
reportByPercent As Boolean
) As OperateResult
protected:
OperateResult^ WriteStreamFromSocket(
Socket^ socket,
Stream^ stream,
long long totalLength,
Action<long long, long long>^ report,
bool reportByPercent
)
member WriteStreamFromSocket :
socket : Socket *
stream : Stream *
totalLength : int64 *
report : Action<int64, int64> *
reportByPercent : bool -> OperateResult
参数
- socket
- 类型:System.Net.SocketsSocket
套接字 - stream
- 类型:System.IOStream
数据流 - totalLength
- 类型:SystemInt64
所有数据的长度 - report
- 类型:SystemActionInt64, Int64
进度报告 - reportByPercent
- 类型:SystemBoolean
进度报告是否按照百分比
返回值
类型:
OperateResult是否成功的结果对象
参见