[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] How to receive only some data
From: |
David Vos |
Subject: |
[lwip-users] How to receive only some data |
Date: |
Wed, 11 Jul 2007 16:35:05 -0600 |
I am running TCP using the callback mechanism in a single process, no threads.
In my tcp_recv() callback function, I have been doing:
for (q = p; q != NULL; q = q->next) {
process(q->payload, q->len);
}
tcp_recved(tpcb, p->tot_len);
pbuf_free(p);
However, there are times where I am not able to process all of the
information. What is the proper way to do it? I assume I should
tcp_recved() the length I processed. But, should I do a pbuf_free()
even if I didn't process all of it? Basically, I am funnelling all
received data into a non-blocking named pipe (fifo), and I need to
push back on the stack if the fifo is full. But when room becomes
available in the fifo, I can start processing the tcp data again.
Let's say that I am unable to process any data for awhile and my TCP
receive window is full. Will the stack still periodically call
tcp_recv() to poll the application? Or do I need to use tcp_poll and
somehow find the received data myself?
Thanks,
-David
- [lwip-users] How to receive only some data,
David Vos <=