@niconrok wrote:
Neither, it happens from time to time doing http get requests on json objects.
Good choice, working with JSON objects!
Off topic: I used JSON objects very often to create a remote GUI for a device. I used this kind of expressions:
/audio_set?room=3&chlist=
[
{"name":"Aux-1L","channel":1,"freq":0},
{"name":"Aux-2L","channel":3,"freq":0},
{"name":"Aux-3L","channel":5,"freq":0},
{"name":"Aux-4L","channel":7,"freq":0},
{"name":"MP3-Stream","channel":17,"freq":0},
{"name":"92.00","channel":9,"freq":9200},
{"name":"107.10","channel":9,"freq":10710}
]
I was able to avoid this issue by block the task for 1ms before doing the shutdown, but that’s rather a bad solution I would say.
Here I miss the logic: right after the SYN you see a message that looks like a keep-alive packet. Why would it be solved when inserting a delay at FIN before the shutdown?
I send you both sides because wireshark shows that the syn packet are not in order on server side. May that trigger a keep alive?
Very good to send a PCAP from both sides! Two packets indeed arrive in a different order!!

Interesting is, that problem only happens on certain lan/wifi topology. It occures when client and server are connected as followed:
client <-wireless-> router <-cable-> mesh node <-wireless-> mesh node <-cable-> server
You probably understand this better than I do 
So may a syn packet order misalignment lead to this behaviour?
I think so, one packet arrived too early.
I’m ready if you need more information.
The keep-alive packet seems misplaced, but it is a logical response from the stack.
But is it a problem? Does it disturb the communication? The effective conversation looks OK :
GET /get_pcu_rev_sw HTTP/1.1
Host: 192.168.1.112
Connection: keep-alive
<snip>
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
HTTP/1.1 200 OK
Connection: close
Content-Type: application/json
{
"pcu_rev_sw":"01000000"
}
Or does it disturb the communication?
Normally, TCP is insensitive for order problems. When packet-B arrives earlier that packet-A, the server will send a Selective ACK (SACK).