If you want to refuse all connections when one connection is active, do the
following in your while(true) kind of loop:
- Do all necessary actions you need to before accepting connections (socket, listen, ...)
- Call accept. This will
wait until a TCP connection is established.
- Once connection has been established (accept has returned), call close on the socket you were
- Do all send and recv calls with the TCP
connection (= the socket that accept had returned).
- close the TCP
connection's socket and loop
Hope this helps
GSM (fr): +33 66 43 00 555 [Bouygues Telecom]
GSM (tr): +90 555 266 52
----- Original Message -----
Sent: Wednesday, October 10, 2007 8:46
Subject: [lwip-users] Limit tcp_listen to
Is there a way to limit the tcp_listen function
to only accept a single connection. I would like to limit a specific
port to accept the first connection request and then refuse any additional
connections until the first connection has been closed. Does anyone know
of a way to do this?