Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Asynchronous Write when server not answering
July 2, 2020
17:48, EET
Sebastien Petitrenaud
New Member
Forum Posts: 2
Member Since:
July 2, 2020
sp_UserOfflineSmall Offline

Hi All,

I’m working with the Prosys SDK version 3.1.2 (perhaps too old, but the question is not here). In our process, we made asynchronous write to the server and add a listener to the serviceResponse to check if the write is ok or not as following :

AsyncResult response = client.writeAsync(valueToWrite);
response.setListener(new WriteResultListener(this, items));

where items is an internal class to store business information.

Sometimes, the opcua server seems to wait for remote servers answer (the opcua server is our point of connection, but is only a gateway to share information with other servers) and if we try to recall the previous code, the write of the command seems to wait the previous answer before sending the command to the server

Am i right ?

July 3, 2020
14:09, EET
Bjarne Boström
Forum Posts: 579
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline


In the world OPC UA and our SDK, that is old. But functionality-wise should not matter in this case.

Is the server also made with our SDK or with something else?

The only thing the XXXAsync methods do is that instead on blocking the calling thread until the server returned a response is that they instead call the callback (on internal worker thread pool) once the server responds. If the server does not respond, we also cannot call the callback. That is to say, if the server choses to process them sequentially with the first one blocking, then it would not start on the second one before the first one completed.

Assuming you could use NONE or just SIGN messagesecuritymode, you can verify this via https://www.prosysopc.com/blog/opc-ua-wireshark/ to see when the actual network traffic happens. You should see both WriteRequests be sent to the server (i.e. one whenever you did call the writeAsync). After server responds with WriteResponse you should see your callback being called.

Some extra notes based on some investigations. Note that the actual internal low-level message sending logic is very old and sort of “battle-tested” in the stack layer. Anyway, it seems due to it the writeAsync could also block if any other message is being sent (just the sending part), i.e. if you would call the method twice, they might both return only after both messages were pushed to the tcp stream. But I would not complete rule out possible bugs there, just that we most likely would have heard them by now if they would be “that major”.

July 3, 2020
15:15, EET
Sebastien Petitrenaud
New Member
Forum Posts: 2
Member Since:
July 2, 2020
sp_UserOfflineSmall Offline

firstly thanks a lot for your answer;

we do not know if the server is made with you SDK or something else, we will check; you answer is very clear, and we will investigate deeper with wireshark;

thanks to you answer, i think that this block comes from the server and not form our side

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online: Jouni Aro, MichaelBraveDigital
11 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 103

pramanj: 86

ibrahim: 70

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 38

Rainer Versteeg: 32

Thomas Reuther: 31

Member Stats:

Guest Posters: 0

Members: 1160

Moderators: 15

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1048

Posts: 4416

Newest Members:

jonas.rahm, sophiekohler, zqecortney, adeletoscano947, forestgenders23, auroratrumper, ericmclain04, rblu, starlowery23194, dakotadalgety82

Moderators: Jouni Aro: 853, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 579, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Teppo Uimonen: 21, Markus Johansson: 24, Matti Siponen: 72, Lusetti: 0

Administrators: admin: 1