[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Few clients
From: |
Gustlik |
Subject: |
[lwip-users] Few clients |
Date: |
Thu, 3 Aug 2006 10:54:53 -0700 (PDT) |
it is possible to listen on one port all the time and have few clients
connected to tcp echo?
in example:
static void
tcpecho_thread(void *arg)
{,
struct netconn *conn, *newconn;
err_t err;
/* Create a new connection identifier. */
conn = netconn_new(NETCONN_TCP);
/* Bind connection to well known port number 7. */
netconn_bind(conn, NULL, 7);
/* Tell connection to go into listening mode. */
netconn_listen(conn);
while(1) {
/* Grab new connection. */
newconn = netconn_accept(conn);
/* Process the new connection. */
if(newconn != NULL) {
struct netbuf *buf;
void *data;
u16_t len;
while((buf = netconn_recv(newconn)) != NULL) {
do {
netbuf_data(buf, &data, &len);
err = netconn_write(newconn, data, len, NETCONN_COPY);
if(err != ERR_OK) {
}
} while(netbuf_next(buf) >= 0);
netbuf_delete(buf);
}
/* Close connection and discard connection identifier. */
netconn_delete(newconn);
}
}
}
but i want to serve more than one client how to do it?
--
View this message in context:
http://www.nabble.com/Few-clients-tf2047111.html#a5637483
Sent from the lwip-users forum at Nabble.com.
- [lwip-users] Few clients,
Gustlik <=