Disconnecting client failure

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...
Post Reply
marsu
Jr. Member
Jr. Member
Posts: 1
Joined: 08 May 2020, 06:54

Disconnecting client failure

Post by marsu »

I have a C# program that communicates with KepServer.
It's working fine but the disconnect feature does not want to work.

I want the code to work so that when KepServer Runtime is booted, OPC client disconnects and tries to reconnect.
Currently code is made so that when it recognizes connection status change to Disconnected, ServerShutdownInProgress, ServerShutdown or ConnectionErrorClientReconnect it tries to disconnect like this: this.session.Disconnect(SubscriptionCleanupPolicy.Delete);
But nothing happens and after a while I get a timeout from this method. I also tried just Disconnect(); and I tried to fiddle with ReconnectDelay but the results are the same. In some rare debugging cases I somehow managed to reconnect the client, but not consistently and I cannot reproduce it anymore.

What am I doing wrong and why the Disconnect is not working? What would be the correct way to work in this kind of situation?

Post Reply