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
Stop publishing
August 24, 2022
13:01, EEST
Avatar
workinprogress
Member
Members
Forum Posts: 3
Member Since:
July 12, 2022
sp_UserOfflineSmall Offline

Hi Team,
I use OPC UA SDK for Java. I would like to enable and disable the communication with the client when the user requests it. Is there a way to stop publishing the server and restart publishing without having to restart UaServer? I tried UaServer.close() but in this case I didn’t come up with a solution unless restarting the Ua Server.

Thanks and regards

August 24, 2022
15:25, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 986
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Please clarify what you mean, but some assumptions: I’ll take this has nothing to do with OPC UA PubSub (you mentioned “publishing” but also “client”). Thus either you mean stop listening to incoming connections and/or a way to close the socket connection between a client and the server?

IF you instead meant PubSub, you should be able to do PubSubSystem.shutdown without shutting down the UaServer. Though it should be noted that we are aware of some issues regarding PubSub, in some cases you might need to currently make a new PubSubSystem, but the intention anyway would be to just be able to PubSubSystem.start it again.

As to closing a Session from within the server. In short it may be possible (but not tried that I can remember) currently by a lot of subtyping UaServer and related components, but there is no intended public-API to do so . In short you kinda do not do that in OPC UA. Though this has been asked at least once before we do have it somewhere in our very big TODO-list. The one possible use-case could be IF a user is removed completely it might be desired to close the session. But basically in all other cases the clients would just try to immediately open the connection again (and they would do so here as well).

For the stopping listening incoming connections, not really a way, but I’m not 100% sure what you mean. However, it is possible that you would be looking for UaServer.shutdown(int secondsTillShutdown, String shutdownReason, boolean closeServer) and using false for the last parameter. From the javadocs “… * @param closeServer determine whether the server is also closed at the same. Use ‘false’ if you
* intend to restart the server again, by calling {@link #start()}. It will leave the node
* managers intact, and they will not need to be re-initialized. Default is true. …”

If that didn’t help, I would need more clarifications on what you mean?

August 24, 2022
17:57, EEST
Avatar
workinprogress
Member
Members
Forum Posts: 3
Member Since:
July 12, 2022
sp_UserOfflineSmall Offline

Hi,
sorry if my question was a bit confusing. I meant exactly that I needed to stop listening incoming connections, and when restarting the UaServer I wanted to leave the node managers intact. Using UaServer.shutdown and using false for the last parameter as you suggested I’ve got the result I was expecting.

Thanks and regards

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 138

pramanj: 86

rocket science: 81

Francesco Zambon: 81

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 713

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1476

Posts: 6294

Newest Members:

mariam6210, donblanchard632, HowardLon, delilahhuggard, salvadorcolby69, HelenImpar, MnoioDat, babuinsobaka, Miikka Mikkonen, rickeylipinski

Moderators: Jouni Aro: 1015, Pyry: 1, Petri: 0, Bjarne Boström: 986, Jimmy Ni: 26, Matti Siponen: 328, Lusetti: 0

Administrators: admin: 1