点击或拖拽改变大小

NetMessageBaseCheckMessageMatch 方法

检查发送的接收的报文是否是匹配的,如果匹配,则返回 1, 如果不匹配且直接返回错误,则返回 0,如果不匹配继续接收,直到匹配或是超时,则返回 -1
If the packet is matched, 1 is returned. If the packet is not matched and an error is returned, 0 is returned. If the packet is not matched, -1 is returned until the packet is matched or times out

命名空间:  HslCommunication.Core.IMessage
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.0.0.0 (12.0.0.0)
语法
public virtual int CheckMessageMatch(
	byte[] send,
	byte[] receive
)

参数

send
类型:SystemByte
当前发送的报文
receive
类型:SystemByte
当前接收的报文信息

返回值

类型:Int32
如果匹配,则返回 1, 如果不匹配且直接返回错误,则返回 0,如果不匹配继续接收,直到匹配或是超时,则返回 -1
备注
在某些协议里,存在一个消息id,发送方的消息id和返回的消息id是必须一致的。
参见