Hi Chistoph:

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 :-)

the LwIP webserver demo code is following, I don’t know how do  you infer it is 
noblocking for incoming data and outgoing ….
Where to wait 1 ms .

void  WebServer_Handler(void *pdata)
{
         struct netconn  *__pstConn, *__pstNewConn;

    __pstConn = netconn_new(NETCONN_TCP);
    netconn_bind(__pstConn, NULL,80);
    netconn_listen(__pstConn);

         for(;;)
         {
                   __pstNewConn = netconn_accept(__pstConn);

                   if(__pstNewConn != NULL)
                   {
                            vHandler_HTTP(__pstNewConn);
                            while(netconn_delete(__pstNewConn) != ERR_OK)
                            {
                                     vTaskDelay(10);
                            }
                   }
    }
}



Vincent Cui
Sr.Firmware Engineer
Mobile: +8613482482211
Tel: +86 21 34612525x6104
Fax: +86 21 34619770
E-Mail: [email protected]<mailto:[email protected]>
Shanghai EnLogic Electric Technology Co., Ltd.
Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 
200233
http://www.enlogic.com

From: [email protected] 
[mailto:[email protected]] On Behalf Of 
Christoph Kronen
Sent: 2011年8月29日 0:48
To: [email protected]
Subject: [lwip-users] FreeRTOS / lwip multiple connections

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
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to