Client closes only TCP socket, servers session still alive?|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Client closes only TCP socket, servers session still alive?
Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
1
10/08/2020 - 03:33
sp_Permalink sp_Print

If a client do

– Open TCP Socket
– CreateSecureChannel
– CreateSession
– /* do something */

– Close TCP Socket (without calling CloseSecureChannel and/or CloseSession)

The server internally closes the TCP socket too as well as the related securechannel.

Is it correct, that the server does NOT cleanup the related session? Only after the session lifetime exceeded the session will be closed.

TIA

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
10/08/2020 - 11:37
sp_Permalink sp_Print

See: https://reference.opcfoundatio…..rt4/5.6.2/

A Server application should limit the number of Sessions. To protect against misbehaving Clients and denial of service attacks, the Server shall close the oldest Session that is not activated before reaching the maximum number of supported Sessions.

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
3
10/09/2020 - 02:54
sp_Permalink sp_Print

– The session was already activated in server

– No CloseSession request was send, only a socket close was send from client to server

– Socket close causes removing securechannel in server

Beware the clients behaviour is not complaint in the situation but can happen for instance a docker container was killed. So the OS closes all sockets.

– Question: Removing securechannel causes Session to switch to “not activated” in server? IMHO not or where is this specified?

Avatar
Randy Armstrong
Admin
Forum Posts: 1579
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
10/09/2020 - 08:39
sp_Permalink sp_Print

The Session and Subscription timeouts exists to give clients time to recover when communication is interrupted. So closing a socket without calling CloseSession means the timeouts need to be honoured because the Server cannot know if it was a network issue and the Client intends to reconnect or if it is gone forever.

The Server can override the timeouts requested if they are too long but other than that there are not any options available to Servers after ActiveSession is called successfully.

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
5
10/11/2020 - 22:40
sp_Permalink sp_Print

I thought so too, thanks for clarification.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 16
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1445
Posts: 4889