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" <[email protected]>
Subject: Re: [lwip-users] Struggling to build a TCP echo server
To: "Mailing list for lwIP users" <[email protected]>
Message-ID: <000e01c98e13$8fa0e960$1d251...@enzo2>
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
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users