Hi,
I am running a python script that performs http requests, and the script open then close the connection on each request. The goal is to transfer a firmware update, so I transfer about 900+ tcp packets with a http body size of about 1024 bytes.
I use freertos+tcp version v4.2.2 and mongoose webserver 7.19.
The issue I have is that after a few packets, the mongoose library no longer get notified from select that it can accept a connection, and forcing mongoose to call FreeRTOS_accept also does not work. I see the usual tcp handshake from freertos+tcp in wirewshark (SYN, SYN+ACK,ACK), but there is just no way to get a client socket from that point on from FreeRTOS_accept.
I have the following log with some of my comments:
run python script, timeout from python script on offset=48124
I see on following log that my handler is getting called for offset=47104, so the previous call was OK (47104 + 1024 == 48124)
comProtocol_updateHandler: write mcuUpdateFw offset=47104
Socket 80 → [192.168.40.2]:10174 State eESTABLISHED->eLAST_ACK
Socket 80 → [192.168.40.2]:10174 State eLAST_ACK->eCLOSE_WAIT
Lost: Socket 80 now has 1 / 128 child
TCP: passive 80 => 2.40.168.192 port 10176 set ESTAB (scaling 0)
Socket 80 → [192.168.40.2]:10176 State eESTABLISHED->eLAST_ACK
Socket 80 → [192.168.40.2]:10176 State eLAST_ACK->eCLOSE_WAIT
Socket 80 → [192.168.40.2]:10175 State eESTABLISHED->eLAST_ACK
Socket 80 → [192.168.40.2]:10175 State eLAST_ACK->eCLOSE_WAIT
Lost: Socket 80 now has 1 / 128 child
FreeRTOS_closesocket[0ip port 80 to c0a82802ip port 10175]: buffers 16 socks 4
mongoose nbr of connections is now 2
run curl (GET request on http port 80), I see SYN,SYN+ACK,ACK in wireshark but cannot accept connection
Gain: Socket 80 now has 2 / 128 children me: 0x2200d590 parent: 0x2200c6e8 peer: 0x2200d388
prvSocketSetMSS: 1460 bytes for c0a82802ip port 10481
Socket 80 → [192.168.40.2]:10481 State eCLOSED->eSYN_FIRST
prvWinScaleFactor: uxRxWinSize 2 MSS 1460 Factor 0
Socket 80 → [192.168.40.2]:10481 State eSYN_FIRST->eSYN_RECEIVED
TCP: passive 80 => 2.40.168.192 port 10481 set ESTAB (scaling 1)
Socket 80 → [192.168.40.2]:10481 State eSYN_RECEIVED->eESTABLISHED
hit ctrl+c after a while because we are getting no response
Have any of you seen anything like this? Is there any config parameter that could prevent this?
Something I could do?
I managed to avoid the issue by not closing the connection on each http request in my script, but I would prefer for our device to be as robust as possible, because once I get the issue I can no longer get any connections on the affected port.
Thanks!