Thanks

Based on your suggtion,

I tried to add a lwip_tcpflush(int s)

int lwip_tcpflush(int s)
{
  struct lwip_socket *sock;
  sock = get_socket(s);
  if (!sock)
    return -1;
  return tcp_output(sock->conn.pcb.tcp);
}

Will it force data flush ?

I will make test.
Thank you very much
On Sat, Dec 13, 2008 at 9:11 PM, Kieran Mansley <[email protected]> wrote:

> On Sat, 2008-12-13 at 20:20 +0800, yueyue papa wrote:
> > Wether it comes out depend the task schedule, if the data is lost in
> > the line, the netconn_write already returned.
>
> Yes, but if it gets lost, TCP should retransmit it.  If you're using
> UDP, and expecting all the data to get through, then that's a problem.
> None of the lwIP APIs have a "send" function that waits until the data
> has successfully crossed the network.
>
> > If it is true, is the any API could i flush the data in the send
> > buffer, force
> > the data send out, and make sure the data has been ACK by remote.
>
> If you do something like this:
>  netconn.pcb.tcp->flags |= TF_NODELAY;
>
> then you will disable Nagle's algorithm, which is the most common reason
> that writes are delayed and batched together for sending.  Note that
> this might result in small transmissions which are inefficient if you're
> about to queue some more data anyway.
>
> However, it sounds like you were hoping that netconn_write() wouldn't
> return until the data had been successfully received and acknowledged by
> the other side.  That still won't be the case if you set TF_NODELAY.
>
> If you were using the raw API you can call tcp_write() to queue the data
> and tcp_output() to send it at times that are sensible for your
> application.
>
> Kieran
>
>
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to