Avatar

Please consider registering
guest

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, EEST
Avatar
Sebastien Petitrenaud
New Member
Members
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, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

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, EEST
Avatar
Sebastien Petitrenaud
New Member
Members
Forum Posts: 2
Member Since:
July 2, 2020
sp_UserOfflineSmall Offline

Hi,
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: 518

Currently Online:
23 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 680

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6260

Newest Members:

sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1