[Top][All Lists]

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

Re: [lwip-users] lwIP in multi-thread environment mixed with raw-api

From: Mark Phillips
Subject: Re: [lwip-users] lwIP in multi-thread environment mixed with raw-api
Date: Fri, 05 Jun 2009 10:48:09 -0400
User-agent: Thunderbird (Windows/20090302)

Hi, Alex,

I have a similar situation, and I am having great problems with it. (Thanks, Kieran for your response to my question).

I am trying to do multiple servers and clients with lwIP. It's basically a protocol converter, that has to connect to a number of remote devices and poll them for data, and at the same time listen on other sockets for someone upstream to connect and poll me.

The problem I am having is that certain operations (like connect) don't seem to return until either the connection is made, or it times out. This is a problem, since (particularly if one of the downstream devices is offline) the whole stack stops while we wait for the connection to be made. Additionally, since this is a standalone unit, we need to continuously try connecting to devices we haven't connected to yet.

I can set things up so that all the socket operations happen from a single task, but I can't have this task get stuck while waiting to make connections. I am using the netconn api; would I be better off using the low-level API, or the BSD API? Or is my understanding of what's happening wrong?

The application works great for multiple servers (listeners), and also for a single client (with no servers). But, whenever I try to mix the two, either the whole process stops (if I prevent multiple requests to be pending simultaneously) or I get nasty memory-corruption/segfaults (if I DO allow multiple requests).

I get the feeling that I'm using the wrong API (or that what I'm trying to do is beyond what lwIP can handle). Any advice would be greatly appreciated!


Alexander Heidt wrote:

I am getting familiar with lwIP right now, on a STM32-Microcontroller. Right now I have the lwIP running in a single thread, works fine. I even built a veeeery simple http-server using the raw-api. Now I am trying to use lwIP with FreeRTOS. My question: As it is stated in the wiki, only ONE application thread using the lwIP-api is permitted. In my application I would like to 1. have the http-server running to serve a config-website and 2. connect to a server to upload some data. As I am not familiar with the lwIP-api yet: Is this possible via the api in one single task? Or is it possible, to leave the http-server I have already as it is (totally done via callbacks), and just use the api to do the data-uploading in my application task?

And one another question regarding PPP: Afaik now PPP needs a multithreaded environment, cause the PPP-daemon runs in its own thread. But what is the status of the PPP-part of lwIP?? Is it still very buggy, or is there somebody having had a good experience with it?? Just to know, if it is worth, trying to use it, or not!

Regards, Alex

lwip-users mailing list

reply via email to

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