lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Listen on more then one port with lwIP


From: YAP
Subject: Re: [lwip-users] Listen on more then one port with lwIP
Date: Fri, 2 Jan 2009 10:55:06 +0100

as you top post I do so to so the source is preserved below.

lwIP version is 1.3
Microchip GCC C32 MIPS compiler
FreeRTOS 5.1.0

By not working I mean  none of the listner threads return after
netconn_accept which they do if I only have one thread.

I pretty much expected this to be a usage fault and that the way I use
dthe code was invalid.

Cheers
/Ake

On Fri, Jan 2, 2009 at 10:31 AM, Muhamad Ikhwan Ismail
<address@hidden> wrote:
>
> Hi,
>
> It would help the developer answer your question, if you explain what do you
> mean by it does not work
> e.g. where it blocks, you are getting no data or something like that. You
> should also search the mailing list
> for previous posts, someone might have asked the same q.
>
> You might want to info them also of your port and version.
>
> Greetings
> Ikhwan
>
>
>> Date: Thu, 1 Jan 2009 23:00:54 +0100
>> From: address@hidden
>> To: address@hidden
>> Subject: [lwip-users] Listen on more then one port with lwIP
>>
>> I am new to lwIP and use it with FreeRTOS on a PIC32 so be patient
>> with me if this is just a silly question.
>>
>> I want to have a web server plus a custom interface on the firmware I
>> work on at the moment. So I try to solve this starting a new thread
>> where I initialised lwip and then start two listner threads for the
>> two ports.
>>
>> This does not work however even if they each work perfect on there own.
>>
>> How should this be coded correctly? Any hints appreciated.
>>
>> My listner thread look like this
>>
>>
>> ///////////////////////////////////////////////////////////////////////////////
>> // taskVSCPListner
>> //
>>
>> void taskVSCPListner( void *pvParameters )
>> {
>> struct netconn *pxVSCPListener; // Listens for VSCP connections
>> struct netconn *pxNewConnection;
>>
>> // Create a new tcp connection handle for VSCP
>> pxVSCPListener = netconn_new( NETCONN_TCP );
>> netconn_bind( pxVSCPListener, NULL, VSCP_LEVEL2_TCP_PORT );
>> netconn_listen( pxVSCPListener );
>>
>> // Loop forever
>> for( ;; ) {
>>
>> // Wait for connection.
>> pxNewConnection = netconn_accept( pxVSCPListener );
>>
>> if ( pxNewConnection != NULL ) {
>>
>> // Service connection.
>> vProcessVSCPConnection( pxNewConnection );
>>
>> while( netconn_delete( pxNewConnection ) != ERR_OK ) {
>> vTaskDelay( webSHORT_DELAY );
>> }
>>
>> }
>>
>> }
>> }
>>
>>
>>
>> ///////////////////////////////////////////////////////////////////////////////
>> // taskHTTPListner
>> //
>>
>> void taskHTTPListner( void *pvParameters )
>> {
>> struct netconn *pxHTTPListener; // Listens for HTTP connections
>> struct netconn *pxNewConnection;
>>
>> // Create a new tcp connection handle for HTTP
>> pxHTTPListener = netconn_new( NETCONN_TCP );
>> netconn_bind( pxHTTPListener, NULL, webHTTP_PORT );
>> netconn_listen( pxHTTPListener );
>>
>> // Create a new tcp connection handle for VSCP
>> //pxVSCPListener = netconn_new( NETCONN_TCP );
>> //netconn_bind( pxHTTPListener, NULL, VSCP_LEVEL2_TCP_PORT );
>> //netconn_listen( pxVSCPListener );
>>
>> // Loop forever
>> for( ;; ) {
>>
>> // Wait for connection.
>> pxNewConnection = netconn_accept( pxHTTPListener );
>>
>> if ( pxNewConnection != NULL ) {
>>
>> // Service connection.
>> vProcessConnection( pxNewConnection );
>>
>> while( netconn_delete( pxNewConnection ) != ERR_OK ) {
>> vTaskDelay( webSHORT_DELAY );
>> }
>>
>> }
>>
>> }
>> }
>>
>> Cheers
>> /Ake
>>
>>
>> --
>> ---
>> Ake Hedman
>> D of Scandinavia, http://www.dofscandinavia.com
>>
>>
>> _______________________________________________
>> lwip-users mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
> ________________________________
> It's the same Hotmail(R). If by "same" you mean up to 70% faster. Get your
> account now.
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>



-- 
 ---
Ake Hedman
D of Scandinavia, http://www.dofscandinavia.com




reply via email to

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