When is onServiceFault called in milo opc ua client?

Tags: , ,



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).

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.

In what cases is the onServiceFault listener executed by milo?

Answer

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.

Shutting down the server like you did should result in onSessionInactive being invoked on any SessionListener you’ve added to the client.



Source: stackoverflow