NetworkBaseSendStreamToSocketAsync 方法 |
发送一个流的所有数据到指定的网络套接字,需要指定发送的数据长度,支持按照百分比的进度报告
Send all the data of a stream to the specified network socket. You need to specify the length of the data to be sent. It supports the progress report in percentage.
命名空间:
HslCommunication.Core.Net
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 protected Task<OperateResult> SendStreamToSocketAsync(
Socket socket,
Stream stream,
long receive,
Action<long, long> report,
bool reportByPercent
)
Protected Function SendStreamToSocketAsync (
socket As Socket,
stream As Stream,
receive As Long,
report As Action(Of Long, Long),
reportByPercent As Boolean
) As Task(Of OperateResult)
protected:
Task<OperateResult^>^ SendStreamToSocketAsync(
Socket^ socket,
Stream^ stream,
long long receive,
Action<long long, long long>^ report,
bool reportByPercent
)
member SendStreamToSocketAsync :
socket : Socket *
stream : Stream *
receive : int64 *
report : Action<int64, int64> *
reportByPercent : bool -> Task<OperateResult>
参数
- socket
- 类型:System.Net.SocketsSocket
套接字 - stream
- 类型:System.IOStream
内存流 - receive
- 类型:SystemInt64
发送的数据长度 - report
- 类型:SystemActionInt64, Int64
进度报告的委托 - reportByPercent
- 类型:SystemBoolean
进度报告是否按照百分比报告
返回值
类型:
TaskOperateResult是否成功的结果对象
参见