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: vincent cui
Subject: Re: [lwip-users] FreeRTOS / lwip multiple connections
Date: Tue, 30 Aug 2011 03:28:07 +0000

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: address@hidden
Shanghai EnLogic Electric Technology Co., Ltd.
Address: 1104-1106, Building A, No.391, Guiping Road, Xuhui District, Shanghai, 200233
http://www.enlogic.com

 

From: lwip-users-bounces+address@hidden [mailto:lwip-users-bounces+address@hidden On Behalf Of Christoph Kronen
Sent: 2011
829 0:48
To: address@hidden
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


reply via email to

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