On Mon, 2009-08-17 at 15:18 +0200, Domen Puncer wrote: > Hello! > > lwIP-1.3.1-rc3 > > I have a rawapi setup where lwip sends a request, and then receives a > reply with size ~100kB, it forwards this reply via other means to > device3 while it's still transferring via lwip, and if the transfer > to device3 fails, it tcp_close()s the tcp connection too. > Now, I'd expect tcp_recv callback to not be called again, but in fact > it is, first time with FIN_WAIT_1, then with FIN_WAIT_2.
If you carry on receiving data after calling tcp_close then you'll continue to get your callback called if it's still set. You should be able to avoid this by setting the callback to NULL once you're no longer interested in the received data. TCP connections have to be closed in both directions before them become inactive, so by closing your end you don't prevent the other end continuing to send to you. There are some API improvements to this planned for 1.4.0: see https://savannah.nongnu.org/bugs/?24830 Thanks Kieran _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
