NetworkBaseReceiveByMessage 方法 |
接收一条完整的 数据内容,需要指定超时时间,单位为毫秒。
Receive a complete data content, Need to specify a timeout period in milliseconds
命名空间:
HslCommunication.Core.Net
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 protected virtual OperateResult<byte[]> ReceiveByMessage(
Socket socket,
int timeOut,
INetMessage netMessage,
Action<long, long> reportProgress = null
)
Protected Overridable Function ReceiveByMessage (
socket As Socket,
timeOut As Integer,
netMessage As INetMessage,
Optional reportProgress As Action(Of Long, Long) = Nothing
) As OperateResult(Of Byte())
protected:
virtual OperateResult<array<unsigned char>^>^ ReceiveByMessage(
Socket^ socket,
int timeOut,
INetMessage^ netMessage,
Action<long long, long long>^ reportProgress = nullptr
)
abstract ReceiveByMessage :
socket : Socket *
timeOut : int *
netMessage : INetMessage *
?reportProgress : Action<int64, int64>
(* Defaults:
let _reportProgress = defaultArg reportProgress null
*)
-> OperateResult<byte[]>
override ReceiveByMessage :
socket : Socket *
timeOut : int *
netMessage : INetMessage *
?reportProgress : Action<int64, int64>
(* Defaults:
let _reportProgress = defaultArg reportProgress null
*)
-> OperateResult<byte[]>
参数
- socket
- 类型:System.Net.SocketsSocket
网络的套接字 - timeOut
- 类型:SystemInt32
超时时间,单位:毫秒 - netMessage
- 类型:HslCommunication.Core.IMessageINetMessage
消息的格式定义 - reportProgress (Optional)
- 类型:SystemActionInt64, Int64
接收消息的时候的进度报告
返回值
类型:
OperateResultByte带有是否成功的byte数组对象
参见