[Top][All Lists]

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

Re: [lwip-users] PBUF Leak Problems...

From: Jonathan Larmour
Subject: Re: [lwip-users] PBUF Leak Problems...
Date: Wed, 19 Sep 2007 18:47:59 +0100
User-agent: Thunderbird (X11/20070530)

Thomas Catalino wrote:
We are using the sockets API. I agree, there could be an issue with the application not reading the data out of the stack. However, the application is complex and we did not write it, so I'll probably have to investigate this from the bottom up - hopefully I can poke around the stack to find out which sockets are backed up with data waiting to be read.

Is there an easy recipe to locate a socket in the stack that is backed up? A few pointers might be very helpful, we can probably follow our noses from there...

If you're using just the sockets API, you could look at the "sockets" array, declared in sockets.c as:

static struct lwip_socket sockets[NUM_SOCKETS];

where struct lwip_socket is:

struct lwip_socket {
  struct netconn *conn;
  struct netbuf *lastdata;
  u16_t lastoffset;
  u16_t rcvevent;
  u16_t sendevent;
  u16_t  flags;
  int err;

That gives you a route to finding out your connections. The 'conn' field is NULL for unused entries. You could use rcvevent to know whether a receive event occured, or more helpfully, look at conn->recvmbox. Each mbox entry (in whatever form your OS stores it in the mbox) is a pbuf (for TCP sockets).

eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
 >>>> Visit us on stand 810 at The Embedded Systems Show 2007, NEC <<<<
 >>>> Oct 17-18 Birmingham, UK http://www.edaexhibitions.com/ess/  <<<<
------["The best things in life aren't things."]------      Opinions==mine

reply via email to

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