Client side: session closed event never received after session is closed by server
Description
Session not closing when server is freeopcua:
An application using the toolkit does cannot detect correctly that the connection is closed with a freeopcua server.
The bug is reproduced on b0936c06 as follows:
- start the
validation/server.py
in the dockertest:2.3
- start
ingopcs_browse i=84
The wireshark trace shows that the server sends the CloseSessionResponse
in response to the CloseSessionRequest
sent through AsynCloseSession
. However, the application event callback does not receive the SE_CLOSED_SESSION
message.
Analysis
The close session response message is refused because the body decoder tries to decode the response header which was already decoded in buffer. Since there is no field to decode, the decoder has nothing to do in this case. It is the case of all messages for which there is only a request/response header and no other fields, the associated body encoder/decoder shall not try to decode header since it is now decoded separately.