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: Muhamad Ikhwan Ismail
Subject: RE: [lwip-users] Listen on more then one port with lwIP
Date: Fri, 2 Jan 2009 09:31:29 +0000


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®. If by “same” you mean up to 70% faster. Get your account now.

reply via email to

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