I have this code with asyncSocket on linux:
while true:
var msgSize = ""
while msgSize.len == 0:
try:
msgSize = await asocket.recv(4, flags={SocketFlag.Peek})
await sleepAsync(200)
except ...
try:
resp = await asocket.recv(4 + msg2Int(msgSize))
(proces message...)
This works as expected, until I get a larger message (16kB, confirmed with wireshark that I actually receive it). What happens is that it gets stuck on recv the first 4 bytes in peek mode, it stays at 0, even though I have not gotten the data out of the socket buffer. If I remove the Peek flag, and adjust the code (remove +4 from the second recv size), I get the expected data.
Any idea what could be going on ?