lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] simultaneous send and recv


From: address@hidden
Subject: [lwip-users] simultaneous send and recv
Date: Mon, 01 Oct 2007 17:38:53 -0500
User-agent: Thunderbird 1.5.0.13 (X11/20070824)

Hi,

I'm using lwip+FreeRTOS to send and receive a stream of small TCP
packets to and from an AT91SAM7X256.  I have three threads that connect
to an external host (linux) and receive the a TCP stream.  I have one
thread that binds to a port, and listens for a new connection.  When it
gets one, it puts the connection onto a linked list before returning to
listening for the next new connection.  Finally I have one last thread
that generates some data and sends it out to each connection in the
linked list.  I am hoping to get around 3 simultaneous streams from the
last thread.  All threads use the Sequential API, and I am using
lwip-1.1.1. 

When just the three receive threads are running, they work great.  When
just the listen and send threads are running, they work great.  However,
if I try to run both the send and receive threads at the same time, it
will work for somewhere between 30 seconds to 5 minutes before something
locks up in lwip. The program stops recieving the incomming stream, and
also stops sending an output stream.  The non-lwip FreeRTOS threads
continue to respond, and something of lwip is still running, because
after a few more seconds, I start to get "out of memory" errors from lwip. 

My question is where do I need to start looking for problems?  I'm
fairly inexperienced with lwip, but I did manage to get debug working
mostly.  Some of the larger debug statements overwhelm the stack
allocated to the thread, but them smaller lines print out fine.  I've
been playing around with enabling different parts of the debugging, but
still haven't got anything on what would be causing the sudden lack of
response. 

I've also been wondering if there is something with lwip not being
entirely thread safe, as I'm accepting the connection in one thread, and
writing to it in another? 

I can post my code if anyone thinks that will help.  Also, would
upgrading to lwip-1.2.0 help? 


Thanks

Andrew




reply via email to

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