Hi,
I'm using raw lwip 1.3.2 as a client for an audio stream based application.
I'm a bit confuse how to handle the incomming pbufs when the audio buffer is
full and I have to wait until the audio buffer has enough space to
accomodate the pbuf.
My code looks something like this:
errt_t http_recv_cb(void *arg, struct tcp_pcb, struct pbuf*p, err_t err)
{
if (connected&& buffer_empty)
{
temp_pbuf = p;
do_the_copy_to_buffer_task();//copy pbuf, free the pbuf and call
tcp_recved()
return OK;
}
else
if (connected&& !buffer_empty) // buffer is full. Pbuf cannot be
process
{
// what should I do here?
// should I free the bpuf here? or just ignore the bpuf and do
nothing here.
// what should I return here?
}
}
What should I do if the buffer is full and I cant process the incomming
pbufs? Should I call pbuf_free() or should I just ignore the incomming
pbufs? Which value should I return?
Thank you.