lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] How to find out if I can send out more UDP packets?


From: Xun Chen
Subject: Re: [lwip-users] How to find out if I can send out more UDP packets?
Date: Tue, 30 May 2017 08:21:24 -0400
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

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" <address@hidden>
To: address@hidden
Subject: Re: [lwip-users] How to find out if I can send out more UDP
        packets?
Message-ID: <address@hidden>
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 ?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]