I'm sorry for the second email.

I noticed in tcp_output():

   /**/* First, check if we are invoked by the TCP input processing//
   //     code. If so, we do not output anything. Instead, we rely on the//
   //     input processing code to call us when input processing is done//
   //     with. *//
   *  if (tcp_input_pcb == pcb) {**
   **    return ERR_OK;**
   **  }*

In the application recv() function, I decide I received all data and now I'm ready to answer with a reply. I call tcp_write() (maybe multiple times) from recv() and then tcp_output(). The previous if has the effect to return immediately from tcp_output(), so its call is useless.

From this I understand tcp_output() could be useful only in the poll() function (when new data is available and should be sent) and sent() function (when new data can be sent after previously sent data has acknowledged).



_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to