[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1310579520.2509.17.camel@edumazet-laptop>
Date: Wed, 13 Jul 2011 19:52:00 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Chris Friesen <chris.friesen@...band.com>
Cc: netdev@...r.kernel.org
Subject: Re: any way to let host act as TCP server OR client on same
IP/port?
Le mercredi 13 juillet 2011 à 10:30 -0600, Chris Friesen a écrit :
> I've been asked an interesting question about TCP. We have some people
> that want to set up a TCP socket that can listen for connections on a
> given IP/port, but also initiate connections from that same IP/port.
> (Only one at a time, of course.)
>
> The TCP state machine seems to allow this (moving from LISTEN to
> SYN_SENT) but it's not a normal transition.
>
> Is there any way to do this using the socket API?
>
> I thought up a hack whereby we could use NFQUEUE to detect an incoming
> SYN and delay it while we call listen() on the socket. Is there any
> better way to do this?
Could you try SO_REUSEADDR, on both listener and connect attempt ?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists