Eclispe Milo处理ActivateSessionRequest中缺少的服务器时机

时间:2018-11-16 15:11:25

标签: session opc-ua milo

我将Eclipse Milo(0.2.3)用于OPC UA通信。 OPC UA的参与者是一个客户端(使用Eclipse Milo编写)和一个服务器,该服务器在远程计算机上运行,​​并且未使用Milo实现。

我可以正常地将客户端连接到服务器,并且如果远程服务器已关闭,则只要服务器可以再次访问,我就能自动重新连接客户端。

但是,在更新服务器软件之后,客户端无法再重新连接,它会向服务器发送以下消息:

  • 创建会话请求
    • 服务器能够创建会话
  • 激活会话请求
    • 服务器发送激活会话响应,其中缺少ServerNonce并且服务结果为“错误”

这将导致客户端发送新的创建会话请求。所有这些都在一秒钟内发生多次,这使得服务器无法执行任何其他任务然后尝试创建此会话。

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
    

预先感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

您描述的这种极端情况是在this commitdev/0.3分支上解决了失败的重新激活和随后的重新创建之间没有延迟的情况。

如果我有空闲时间,下周我可能可以将其移植到0.2.x

我不认为您可以使用任何解决方法。