Closed chmielewskiandreas closed 1 year ago
The log message look like this is either quite old, or modified client.
I cannot anymore replicate the exact issue, but I found couple that could be causing this behaviour. Please see #55030 If you still have the set up, can you try out if this fixes the exact issue that you are facing.
Thanks @SeppoTakalo. This solved the issue.
Describe the bug
Once the RDClient is in suspended state a socket error (in my example taking the modem offline) causes that the socket is broken after the RDClient is resumed.
Steps to reproduce the behaviour. Please take the example below (just replace lwm2m_client example with this version) and execute
1) client start_network 2) client start 3) client pause 4) client stop_network 5) client start_network 6) client resume
You will see that the state machine loops within ENGINE_UPDATE_SENT until a timeout occurs. A short debugging session tracked this down to socket_fault_cb method where lwm2m_socket_close is called. This method closes the socket and because of this lwm2m_close_socket will not be called later on and connection_suspended flag will not be set to true.
Reading the code of suspending and resuming the RDClient I see a big requirement for refactoring. In particular the place/way socket is closed should be refactored e.g. lwm2m_socket_close and lwm2m_close_socket is quite irritating.