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
----- Original Message -----
From: Chen
To: [email protected]
Sent: Friday, February 13, 2009 1:28 PM
Subject: Re: [lwip-users] Struggling to build a TCP echo server
Hi, Francois,
Thanks for your suggestion!
I've never used netconn_* API, what is the difference/advantage/disavantage
between netconn_* API and the ones I used?
Do you have a skeleton codes for the basic echo server using netconn_* API?
Chen
Hi Chen,
I'm working on a similiar project : basic echo server with FreeRTOS, but me
I use the netconn_* API. Right now it accepts only one connection, but I must
program the server to allow multiple socket simultaneously, like you need to.
By the way i'm very new into socket programming.
I did'nt tried anything yet but thought of ways to acheive that:
a.. bind every port/address you need, then listen to them.
b.. create a task that waits for client to connect;
c.. once a client connected, this task should start/resume the echo
server task (which shall be the same code for every connections)
d.. Try to share and manage lwIP ressource between all tasks.
good luck
Francois
------------------------------------------------------------------------------
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users