[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] Correct procedure in callback functions set with
From: |
paul wisbey |
Subject: |
[lwip-users] Re: [lwip] Correct procedure in callback functions set with tcp_recv() & udp_recv() |
Date: |
Thu, 09 Jan 2003 00:25:01 -0000 |
Ok, thanks for the clarification Kieran... there's one other thing about
pbufs though... when calling udp_send() I need a properly constructed
pbuf. I imagine this involves pbuf_alloc(), but I was expecting a PBUF_UDP
option for the protocol layer param. Anyway, my attempt is:
packet_buf = pbuf_alloc(PBUF_TRANSPORT, pktSize, PBUF_RAM);
memcpy(packet_buf->payload, send_buf, pktSize);
udp_send(pcb, packet_buf);
Is there anything obviously wrong/missing here?
Paul
>From: Kieran Mansley <address@hidden>
>Reply-To: address@hidden
>To: address@hidden
>Subject: Re: [lwip] Correct procedure in callback functions set with
>tcp_recv() & udp_recv()
>Date: Tue, 16 Jul 2002 15:56:32 +0100 (BST)
>
>On Tue, 16 Jul 2002, paul wisbey wrote:
>
> > Hi,
> > the rawapi.txt mentions that tcp_recved() should be called after
> > receiving tcp segments, ie. when the function set with tcp_recv() is
>called.
> > Should I also be calling pbuf_free()? (I've had problems if I don't
>do
> > this). Is this different with the corresponding UDP callback function?
>(I
> > haven't tried that yet). Thanks,
>
>Yes, you should also call pbuf_free, once you've finished with the data.
>This might not be straight away, but if you don't you'll run out of pbufs.
>I'm pretty sure this is the same for UDP.
>
>Kieran
>
>
>
>[This message was sent through the lwip discussion list.]
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
[This message was sent through the lwip discussion list.]