[Top][All Lists]

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

[lwip-users] minimal echo example

From: Christiaan Simons
Subject: [lwip-users] minimal echo example
Date: Wed, 12 Oct 2005 08:53:45 +0200

Hi all,

I'm tinkering around with the 'minimal' echo (tcp) example.
At first, it didn't work at all. I've added a NULL pbuf ptr
check around pbuf_free() in close_conn() to get it in
some workable state.

The echo server seems to run fine for a couple of echos (50 or so),
but when really pushing it, it stumbles.

Then I found the echo server failed when performing an 'active close'.
I've tried to fix this by adding in echo_recv() an extra test before
calling close_conn()

if (p == NULL) { --> if ((es == NULL) || (p == NULL)) {

Now, the acive close seems to work fine, but now I'm
hitting a out-of-memory condition after about 1000 .. 2000 echos.

I get a "Could not allocate pbuf" in the FIN_WAIT_2 state.
There must be a memory leak somewhere, the pbuf.used count
reaches the PBUF_POOL_SIZE.

Anyone got a suggestion where to look?
Do I need to pbuf_free() in echo_recv in one
of the exceptional/error cases?

BTW: The unixsim example builds with a lot of warnings,
I didn't dare to touch that one yet.


Christiaan Simons

Hardware / Software Engineer
Axon Digital Design

+31 (0)13 511 66 66
+31 (0)13 511 41 51


This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named.  If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.

reply via email to

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