connect() keep returning error 119 - EINPROGRESS
Our 32MZ2048EFM100 MCU runs wolfmqtt-1.1.0 client with wolfssl-3.15.3 (TLSv1.2) on our customized company board (not an evaluation board). We are using Harmony v1.08 and configured it half-manually (without using the MPLAB Harmony configurator).
The TCPIP communication is done over Microchip's berkeley sockets api.
The client communicates with server perfectly except for a special scenario that we observe:
The problem arises when we run a test that network shuts down (router is powered off and then back on again). When the network comes back again, sometimes the MCU fails to reconnect to network.
After some exhausting debug (it does not reproduce every time) we discovered that "connect()" callback in file berkeley_api.c keep returning error 119 - EINPROGRESS forever and never recovers.
I noticed that it usually happens when we power the router off after at least 20 minutes of continuous successful connection between client and MQTT server (called broker) without any data transfer (just MQTT keep alives).
Can you please help me understand what the problem is?