lwip-users
[Top][All Lists]
Advanced

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

Re: Re: [lwip-users] Struggling to build a TCP echo server


From: Chen
Subject: Re: Re: [lwip-users] Struggling to build a TCP echo server
Date: Fri, 13 Feb 2009 16:19:00 -0500

Maybe I missed something, but all I need to kill my working echo server is to add this line (in the same thread)

lSocket2 = socket(AF_INET, SOCK_STREAM, 0);

So that my code turns into this:

int lSocket;
int lSocket2;
struct sockaddr_in sLocalAddr;

lSocket = socket(AF_INET, SOCK_STREAM, 0);
lSocket2 = socket(AF_INET, SOCK_STREAM, 0);

....



Date: Fri, 13 Feb 2009 14:45:01 -0500
From: "Francois Bouchard" <address@hidden>
Subject: Re: [lwip-users] Struggling to build a TCP echo server
To: "Mailing list for lwIP users" <address@hidden>
Message-ID: <address@hidden>
Content-Type: text/plain; charset="iso-8859-1"

I don't know any difference/advantage/disavantage of using the netconn_* API, or maybe one its simple, and its the one I started with.  Beside this, I can show you some of the code which has httpserver-netconn project has starting point (with modification):


  while(1)
  {

          // Wait for connection
          newconn = netconn_accept( conn );

          if( newconn != NULL )
          {
               /* msg */
               printf("%s\n", lwip_strerr(netconn_err(newconn)));
    
               while(http_server_serve(newconn) == ERR_OK)
               {;}
    
               /* server has encountered an error */
               netconn_delete(newconn);
         }
  }
Francois

reply via email to

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