I have been using LWIP for a while and something that keeps messing me up
is the tcp_pcb, and I see this with new users too.   Specifically, when you
set up a tcp_listen you pass in a tcp_pcb and get one returned, which you
pass to tcp_arg() and tcp_accept().   Many people think this is the same
tcp_pcb pointer that is passed to the accept() message, which confuses lots
of people.

A simple suggestion would be to typedef an alternative name for the tcp_pcb
depending on use.  This would make it clear which tcp_pcb pointer needs to
be used for which function.   Also which one needs to be saved and
referenced for the "connection".

Again I have made this mistake so many times myself, especially when not
using lwip for a few years and then using again.

Thanks
Trampas
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to