Sergio, Thanks for your reply. I was out of the country until today, sorry for the late reply

The problem is similar to the following pseudo codes:

while (1)
{
    p=pbuf_alloc()
    memcopy (p->payload,...)
    err=     udp_sendto (...)
    pbuf_free(p)

/*if I delay a little here, err will be 0, otherwise, it will generate -1 eventually*/
}

Maybe I should track down the return from pbuf_alloc to confirm that I indeed have a valid buffer

Message: 1
Date: Mon, 15 May 2017 09:54:53 -0300
From: "Sergio R. Caprile" <scapr...@gmail.com>
To: lwip-users@nongnu.org
Subject: Re: [lwip-users] How to find out if I can send out more UDP
        packets?
Message-ID: <f9ed410a-78fd-68fb-2849-a31051940...@gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed

sendto adds a header to the pbuf you allocated and calls the send
function on your driver, so, basically, if you don't have an RTOS or
some esoteric magic around, I don't see how can you be running out of
memory unless your driver or other application is also using it and you
don't free it.
Could you describe your scenario so we can make an educated guess ?



_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to