简体   繁体   English

什么时候在 milo opc ua 客户端中调用 onServiceFault?

[英]When is onServiceFault called in milo opc ua client?

I hava a milo opc ua client and added a fault listener with client.addFaultListener(this) and I have overridden the method onServiceFault (so that it implements ServiceFaultListener).我有一个 milo opc ua 客户端并使用 client.addFaultListener(this) 添加了一个故障侦听器,并且我已经覆盖了 onServiceFault 方法(以便它实现 ServiceFaultListener)。

When I shutdown my opc ua server I only get a messages from milo: [WARNING][org.eclipse.milo.opcua.sdk.cli] [4] Keep Alive failureCount=1 exceeds failuresAllowed=0 but my fault listener is not executed.当我关闭我的 opc ua 服务器时,我只收到来自 milo 的消息:[WARNING][org.eclipse.milo.opcua.sdk.cli] [4] Keep Alive failureCount=1 超过 failuresAllowed=0 但我的故障侦听器未执行.

In what cases is the onServiceFault listener executed by milo? milo在什么情况下会执行onServiceFault监听?

It's called when the client actually receives a ServiceFault response from the server, which can happen in a variety of scenarios, one of which being that the server doesn't support a service that you've called.当客户端实际收到来自服务器的 ServiceFault 响应时调用它,这可能发生在多种情况下,其中一种是服务器不支持您调用的服务。

Shutting down the server like you did should result in onSessionInactive being invoked on any SessionListener you've added to the client.像您一样关闭服务器应该会导致在您添加到客户端的任何 SessionListener 上调用onSessionInactive

I think I can now answer my question by myself: for example it is called when the servers connection is lost and milo does a reconnect but the transfer of subscriptions fails and when this invalid subscription is used afterwards, then milo will execute a ServiceFault like this with status Bad_SubscriptionIdInvalid.我想我现在可以自己回答我的问题了:例如,当服务器连接丢失并且 milo 重新连接但订阅传输失败并且之后使用此无效订阅时调用它,然后 milo 将像这样执行 ServiceFault状态为 Bad_SubscriptionIdInvalid。

ServiceFault(responseHeader=ResponseHeader(timestamp=DateTime{utcTime=132556030188286769, javaDate=Wed Jan 20 08:56:58 CET 2021}, requestHandle=116, serviceResult=StatusCode{name=Bad_SubscriptionIdInvalid, value=0x80280000, quality=bad}, serviceDiagnostics=null, stringTable=[], additionalHeader=ExtensionObject{encoded=ByteString{bytes=null}, encodingId=NodeId{ns=0, id=0}})) 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM