1
votes

I'm using node-opcua 0.0.64. I'm trying to write a boolean value for one variable using opcuaSession's write method in my client. Some calls are successful but about 70% are not. After exactly 60 seconds the response says "Transaction has timed out", status code is "statusCode" is "undefined error". Can I do some actions in the client? How about transportTimeout ? I believe that it's set to 10000 as default.

1

1 Answers

1
votes

Server will drop the connection if no transaction are made between the client and the server within the session timeout interval.

To make sure that the connection stays up, client usually uses 2 techniques:

  • either issue a ReadRequest transaction on a regular basis ( reading ServerStatus for instance)

  • establish a empty subscription. Subscriptions have a built-in keep-alive mechanism that forces client and server to communicate at least an empty PublishRequest/PublishResponse once in a while.

Note that you can pass keepSessionAlive: true as a parameter to your NodeOPCUA Client, to install a periodic ServerStatus reading.

Alternatively, the timeout on a specific writeRequest could be caused by the server itself if it doesn't reply within the allocated time for the request to proceed. This will pretty much be a issue with the server implementation itself in this case.