我在我的项目中使用 Eclipse Milo (0.2.3) 进行 OPC UA 通信。OPC UA 参与者是一个客户端(使用 Eclipse Milo 编写)和一个在远程机器上运行的服务器,而不是使用 Milo 实现的)。
我可以将客户端正常连接到服务器,如果远程服务器关闭,我可以自动重新连接客户端,只要再次访问服务器。
但是,在更新服务器软件后,客户端无法再重新连接,它会向服务器发送以下消息:
- 创建会话请求
- 服务器能够创建会话
- 激活会话请求
- 服务器发送Activate Session Response,其中缺少ServerNonce,服务结果为“bad”
这会导致客户端发送一个新的创建会话请求。这一切在一秒钟内发生多次,这使得服务器无法执行任何其他任务然后尝试创建此会话。
Milo中是否有任何设置来指定重新连接延迟?或者是否有任何设置用于在接收空的 ServerNonce 时设置应该发生的情况?
服务器的响应如下:
如果可以激活会话:
OpcUa Binary Protocol Message Type: MSG Chunk Type: F Message Size: 96 SecureChannelId: 1599759116 Security Token Id: 1 Security Sequence Number: 53 Security RequestId: 3 OpcUa Service : Encodeable Object TypeId : ExpandedNodeId NodeId EncodingMask: Four byte encoded Numeric (0x01) NodeId Namespace Index: 0 NodeId Identifier Numeric: ActivateSessionResponse (470) ActivateSessionResponse ResponseHeader: ResponseHeader Timestamp: Nov 16, 2018 14:05:47.974000000 RequestHandle: 1 ServiceResult: 0x00000000 [Good] ServiceDiagnostics: DiagnosticInfo EncodingMask: 0x00 .... ...0 = has symbolic id: False .... ..0. = has namespace: False .... .0.. = has localizedtext: False .... 0... = has locale: False ...0 .... = has additional info: False ..0. .... = has inner statuscode: False .0.. .... = has inner diagnostic info: False StringTable: Array of String ArraySize: 0 AdditionalHeader: ExtensionObject TypeId: ExpandedNodeId EncodingMask: 0x00 ServerNonce: ab... Results: Array of StatusCode ArraySize: 0 DiagnosticInfos: Array of DiagnosticInfo ArraySize: 0
如果会话无法激活(更新服务器软件后):
OpcUa Binary Protocol Message Type: MSG Chunk Type: F Message Size: 64 SecureChannelId: 1599759041 Security Token Id: 1 Security Sequence Number: 61 Security RequestId: 11 OpcUa Service : Encodeable Object TypeId : ExpandedNodeId ActivateSessionResponse ResponseHeader: ResponseHeader Timestamp: Nov 16, 2018 12:49:08.235000000 RequestHandle: 222 ServiceResult: 0x80000000 [Bad] ServiceDiagnostics: DiagnosticInfo EncodingMask: 0x00 .... ...0 = has symbolic id: False .... ..0. = has namespace: False .... .0.. = has localizedtext: False .... 0... = has locale: False ...0 .... = has additional info: False ..0. .... = has inner statuscode: False .0.. .... = has inner diagnostic info: False StringTable: Array of String ArraySize: 0 AdditionalHeader: ExtensionObject TypeId: ExpandedNodeId EncodingMask: 0x00 ServerNonce: <MISSING>[OpcUa Null ByteString] Results: Array of StatusCode ArraySize: 0 DiagnosticInfos: Array of DiagnosticInfo ArraySize: 0
预先感谢您的帮助。