NetworkBaseReceiveCommandLineFromSocketAsync 方法 (Socket, Byte, Byte, Int32) |
接收一行命令数据,需要自己指定这个结束符,默认超时时间为60秒,也即是60000,单位是毫秒
To receive a line of command data, you need to specify the terminator yourself. The default timeout is 60 seconds, which is 60,000, in milliseconds.
命名空间:
HslCommunication.Core.Net
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 protected Task<OperateResult<byte[]>> ReceiveCommandLineFromSocketAsync(
Socket socket,
byte endCode1,
byte endCode2,
int timeout = 60000
)
Protected Function ReceiveCommandLineFromSocketAsync (
socket As Socket,
endCode1 As Byte,
endCode2 As Byte,
Optional timeout As Integer = 60000
) As Task(Of OperateResult(Of Byte()))
protected:
Task<OperateResult<array<unsigned char>^>^>^ ReceiveCommandLineFromSocketAsync(
Socket^ socket,
unsigned char endCode1,
unsigned char endCode2,
int timeout = 60000
)
member ReceiveCommandLineFromSocketAsync :
socket : Socket *
endCode1 : byte *
endCode2 : byte *
?timeout : int
(* Defaults:
let _timeout = defaultArg timeout 60000
*)
-> Task<OperateResult<byte[]>>
参数
- socket
- 类型:System.Net.SocketsSocket
网络套接字 - endCode1
- 类型:SystemByte
结束符1信息 - endCode2
- 类型:SystemByte
结束符2信息 - timeout (Optional)
- 类型:SystemInt32
超时时间,默认无穷大,单位毫秒
返回值
类型:
TaskOperateResultByte带有结果对象的数据信息
参见