lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] asynchronous send Not working.


From: Andrew Xiang
Subject: [lwip-users] asynchronous send Not working.
Date: Fri, 11 May 2012 14:24:46 -0400

I use the RAW API. If I send out the 8K data inside the recv function, everything is fine. But if I do the send later in the main(), I get some strange problem. (long delay and TCP data corruption)

accept.
 /* Configure LwIP to use our call back functions. */
  tcp_err(pcb, tcpserver_conn_err);
  tcp_recv(pcb, tcpserver_recv);
 tcp_poll(pcb, tcpserver_poll, 10);


Inside the
tcpserver_recv:
{
   receive packet.
   tcp_write ( 10K bytes);
}

No problem.

If I modify the program to asynchronous send. it will mess up the data. (data slow, BAD TCP CRC, basically screw the MAC chip and needs a reset)

tcpserver_recv:
{
   receive packet.
   rememember pcb.
}

main
{
 while(1)
 {
  If(have_data)
  tcp_write(saved_pcb, data(10KB));
  }
}

What do I have to do different for asynchronous send?

receive signal.
send out data later instead of inside the RECV function.




reply via email to

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