lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] FreeRTOS / lwip multiple connections


From: FreeRTOS Info
Subject: Re: [lwip-users] FreeRTOS / lwip multiple connections
Date: Sun, 28 Aug 2011 19:43:15 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20110812 Thunderbird/6.0

Is this the project you are referring to?

http://interactive.freertos.org/entries/20290712-freertos-win32-project-with-lwip-web-server

If so, look at the command interpreter rather than the web server.  It
uses sockets, and although it is structure to only process one
connection at a time, I think converting it to allow multiple
connections should be simple (?).

>   * checks for incoming data (nonblocking)
>   * checks a Queue for outgoing data (nonblocking)
>   * wait 1 ms (to prevent 100% cpu usage)
>   * repeat :-)

This does not sound like a good solution, unless you are running at the
lowest (idle) task priority.  At any other priority, you are still going
to be using most of the CPU time even when there is no processing to
perform.  A better solution would be to block the TCP/IP processing
until a TCP/IP related event occurs - a semaphore or queue can be used
to signal the event, so the task blocks on the queue.  An event can be
external, like a packet arriving, or internal, like a buffer becoming
free, or an ARP timer event, or data to be sent, etc.

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers.
More than 7000 downloads per month.



On 28/08/2011 17:48, Christoph Kronen wrote:
> Hi all,
> 
> I am using FreeRTOS 7.0.1 on a Sam7X512 and upgraded the contributed
> port lwIP 1.3.0 to 1.3.2.
> 
> The "lwIP Embedded Webserver Demo" is what I took as a starting point. I
> removed the webserver functionality, now I have a task that
> 
>   * checks for incoming data (nonblocking)
>   * checks a Queue for outgoing data (nonblocking)
>   * wait 1 ms (to prevent 100% cpu usage)
>   * repeat :-)
> 
> 
> This works pretty well, I get around 1400 kbyte/s RX and TX.
> Now to my question: Is it possible/difficult/easy to transform this
> functionality to accept multiple connections on the same port ? At the
> moment I am using the netconn API, so I guess I have to switch to the
> Socket API ?
> 
> I read through Richards thread on his "FreeRTOS/lwip Win32 simulator"
> project and it sounds as if it is quite difficult to have multiple
> connections in a multithreaded environment. Unfortunately I could not
> find other helpful topics or contributed examples.
> 
> I am rather new to FreeRTOS and lwIP, so please excuse me if I am
> missing something obvious :-)
> 
> Please give me some comments / suggestions / tips / pushes into the
> right direction.
> 
> Thank you very much !
> 
> Christoph
> 
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

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