Skip to main content
Sadegh Ghorbani
Associate
Oct 5, 2018 10:48 AM UTC
Question

Can't send TCP message exactly more than 1000 times

Hi

I'm using STM32F439 Dev Board and LWIP as TCP/IP stack; I'm using TCP echo

server example. the board is connected to PC. when I send a message from PC

to the board, it echoes back the message. But there is a problem. after

sending exactly 1000 messages I don't receive the message from the board

anymore. I used RAW and NETCONN API and both of them had the same problem.

The problem For UDP echo server/client there isn't. Please help me to

resolve this issue

    This topic has been closed for replies.

    2 replies

    Danish1
    Lead III
    Oct 7, 2018 9:24 AM UTC

    It seems surprising that it is exactly 1000 messages.

    How do you send those 1000 messages? Do you (for example) send 1 per second from the PC?

    Do you get any diagnostic messages from LWIP?

    How does the Wireshark trace differ before and during/after the failure?

    You could have a memory-leak and get an allocation failure after that many messages.

    Remember that TCP takes significant (tens of seconds) time to "tear-down" the link, and the server should keep information about a link until that time has expired. So if you make too many connections over a short period, the server will run out of memory.

    Hope this helps,

    Danish

    Sadegh Ghorbani
    Associate
    Oct 8, 2018 11:14 AM UTC

    Thanks for your answer. the problem resolved. I used another IDE then the problem resolved!!!