[Top][All Lists]

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

Re: [lwip-users] Multiple servers under LwIP

From: Sylvain Rochet
Subject: Re: [lwip-users] Multiple servers under LwIP
Date: Sat, 7 Feb 2015 17:26:29 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hello Robert,

On Sat, Feb 07, 2015 at 10:18:29AM -0500, Robert Deschambault wrote:
> Hi,
> I am using the latest sources from the master branch and I am running on a
> STM32F429 under CMSIS-RTOS/RTX.  I am putting together a framework for our
> application that includes multiple servers each running in its own thread.
> I have written and tested the code for each server individually and they
> work fine.  They are essentially a UDP server and a TCP server that
> responds to messages from the client to request small packets of
> information.  They are running on different ports.  However, when I try to
> run both servers in my framework my TCP server seems to stop responding to
> requests after I have done a UDP request.  I am fairly new to LwIP, can
> anyone guide me as to what might be happening and why I can run each server
> ok but they can't seem to run together at the same time?

As usual, it looks like a broken port or usage which do not follow lwIP 
threading model.


- Do *NOT* call anything in interrupt context, nothing, never, never,
use your OS semaphore signaling to an Ethernet/serial/… RX thread
- memp_* functions are thread-safe if SYS_LIGHTWEIGHT_PROT is
set, and again, thread safe does not mean it is interrupt safe, especially
if your hardware does nested interrupts
- Do *NOT* call any function from the RAW API outside lwIP thread
- Use Netconn or Socket API in others threads, but keep in mind you
should not share a Netconn/Socket control block between threads, (or use
proper locking if you really have to, of course).

I should really add a hook in my MUA to answer that :-)


Attachment: signature.asc
Description: Digital signature

reply via email to

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