Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate Session takes higher time around 40 seconds when reconnecting to OPC Server over LAN #202

Open
pradeipk opened this issue Jun 11, 2020 · 7 comments

Comments

@pradeipk
Copy link
Contributor

No description provided.

@pradeipk
Copy link
Contributor Author

Below is code snippet for reconnect when LAN or OPC Server goes down

sessionChannel.closeSecureChannel();
TransportChannelSettings settings = new TransportChannelSettings();
settings.getOpctcpSettings().setConnectTimeout(2000);
settings.setDescription(this.endpoint);

// get a new secure channel to our already identified endpoint
SecureChannel channel = client.createSecureChannel(getDiscoveryEndpointUri(), this.endpoint);
// create a new SessionChannel from the old session and the new secure channel
sessionChannel = sessionChannel.getSession().createSessionChannel(channel, this.client);
sessionChannel.activate();

In the last step activate session is taking very high time around 40000 ms which is causing the other part of our client code breaking. This is happening when the client is connected to remote OPC Server . It works fine when the client and OPC Server are running on the same machine.

@jouniaro
Copy link
Contributor

This either depends on the server (which server are you connecting to?) or your network, most probably. You should analyse the traffic with WireShark to see which messages are being sent and where the actual delay is. See https://www.prosysopc.com/blog/opc-ua-wireshark/ for details on how to do that

@pradeipk
Copy link
Contributor Author

pradeipk commented Jun 11, 2020

@jouniaro thanks for the quick reply, we will analyse the wireshark trace, meantime can you tell if it means that activate session has different turnaround time for different OPC Server. If this is true then in our client we need to tune different timeout for different servers.
Can you also suggest a way to set shorter reconnect timeout, because reconnect in our client happens in synchronized block which keeps other threads in waiting state which is breaking the further functionality of our connector client.

@jouniaro
Copy link
Contributor

Yes, it depends on the connection and server of course how quick you get the response.

@pradeipk
Copy link
Contributor Author

Thanks @jouniaro, so we can not fix this issue at the client end by any means if the end server itself is delaying the response or do you suggest any workaround here ?

We are getting this issue for Prosys, Softing, Ua ansic OPC Simulation Servers. These are free versions do you see any improvement in turnaround time with paid versions of the same servers.

@jouniaro
Copy link
Contributor

We have never experienced such delays with any of these servers ourselves, so you must have a problem in your network.

@pradeipk
Copy link
Contributor Author

thanks @jouniaro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants