lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] LwIP TCP Server crashes after two accepted connections


From: Sergio R. Caprile
Subject: Re: [lwip-users] LwIP TCP Server crashes after two accepted connections simultaneously
Date: Fri, 22 Feb 2019 10:02:22 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

There is no printf in lwIP, that is your own/vendor mechanism, and this
is where you should start checking for the reason triggering the msg.
Ask your vendor if it is not yours.

AFAIK your recv callback is incorrect, if your tcp_close() fails, you
retry later, you don't call tcp_abort() (I guess 2.1 retries by itself
but I haven't checked on this).
AFAIK when you get called in your error callback, you don't have to mess
with the "parent" (listening) pcb, whatever needs to be done to your
"child" (connection) pcb has already been managed for you, quote: "The
corresponding pcb is already freed when this callback is called!". The
listening pcb will survive and stay listening.
You can read the docs here:
https://www.nongnu.org/lwip/2_1_x/group__tcp__raw.html
The sent callback is used to send more data, to keep the flow going, the
stack tells you when the other end ACKed the data you just crammed into
the TCP buffer.

You are not calling lwIP both from interrupts and the main loop... are you ?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]