[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] tcp raw API - accept only one connection
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] tcp raw API - accept only one connection |
Date: |
Mon, 28 Jun 2010 11:51:29 +0200 |
Kieran Mansley wrote:
> > 1. Listen on port n
> > 2. Accept a new connection
> > 3. Close Listen port, and don't accept any more connection.
> > 4. Process the new connection
> > 3. After processing, close connection and go to step 1.
> >
> > ***Question: How to close listening port ? ****
> > I tried to call tcp_close(), but the port is still binded, i am not
> > able to bind another pcb to same port again.
What does "the port is still binded" mean? Is the original pcb still active?
I'd imagine that the stack only refuses to reuse the port for a listen pcb
because old connection pcbs in state TIME_WAIT are using the port. If so, by
using SO_REUSEADDR (only works in CVS HEAD, not in 1.3.2), you should be able
to proceed as in the list above.
Simon
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01