01/07/2022
I have developed OPC UA SERVER application using CSharp(C#) language.
My requirement is
OPC UA server shall close an established OPC UA session when OPC UA client is seen as inactive during a configurable period of time.
I have tried the following way
1.set maximum session timeout = 60000ms in OPC UA Server(in config) and run the OPC UA Server
2.Connect OPCUA Server with UA Expert (OPC UA Client)
3.Disconnect UAExpert
4. wait for more than 1 minute
5. check session has removed in server
Â
Once I disconnect the UA Expert session is closed automatically. the following event has raised when disconnect the UA Expert.
private void EventStatus(Session session, SessionEventReason reason)
{
LastEventTime = DateTime.UtcNow;
PrintSessionStatus(session, reason.ToString());
}
My question is:
OPC UA Server is not waiting till 1min to close the server session.session is closed immediatly when disconnect the UAExpert
Can you help me? how to achieve it?
01/07/2022
I have developed a OPC UA Client by following way. But when I close the OPC UA Client, the session has removed from the server immediately, but I have configured server session timeout is 60sec
OPCUA Client code:
oPCUAServerUrl = "opc.tcp://" + "localhost" + ":" + "62541";
client = UAClientFactory.GetClient(_oPCUAServerUrl);
client.KeepAliveInterval = 600000;
client.StateChanged += _client_PrimaryServer_StateChanged;
client.Connect();
So what changes required in this code for client that keeps the socket open but does not send any requests to the server?
2 Guest(s)