[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Using netbufs
From: |
Martin Velek |
Subject: |
Re: [lwip-users] Using netbufs |
Date: |
Thu, 18 Feb 2010 13:18:58 +0100 |
Hello,
I had a similar problem. The workaround is to make an artifical
reference to the data.
However as Simon said, be careful if you are using a DMA driver. My
case was simple - Server/Client approach with waiting for response
else retransmitt.
In the enclosure is a simple example. It is not a functional code, just snippet.
Good luck
Martin
On 17 February 2010 23:24, Joe Dupre <address@hidden> wrote:
>
> I have a simple application that sends out a UDP packet every few seconds.
> When using the raw API, I created a raw pbuf in ram, filled the payload, and
> then had udp_send() send that same pbuf over and over from my lwip task.
>
> Now with the Netconn API, I've created separate task to do this. I create a
> netbuf, fill the payload, and call netconn_sendto(). The first time the
> packet is sent as expected, but when netconn_sendto() returns, the length of
> my netbuf has changed, and the payload is in a different location.
>
> I see that as the netbuf's pbuf gets passed toward the interface, headers get
> added to the payload. But after the packet is sent the headers are not
> removed and the netbuf I get back is no longer the netbuf that I started with.
>
> Are netbufs only designed to be used once and then thrown away?
>
> - Joe
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
udpsample.txt
Description: Text document