netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* any way to let host act as TCP server OR client on same IP/port?
@ 2011-07-13 16:30 Chris Friesen
  2011-07-13 17:52 ` Eric Dumazet
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Friesen @ 2011-07-13 16:30 UTC (permalink / raw)
  To: netdev

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?

Thanks,

Chris


-- 
Chris Friesen
Software Developer
GENBAND
chris.friesen@genband.com
www.genband.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-07-14 17:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-13 16:30 any way to let host act as TCP server OR client on same IP/port? Chris Friesen
2011-07-13 17:52 ` Eric Dumazet
2011-07-13 18:05   ` Rick Jones
2011-07-13 19:16     ` Chris Friesen
2011-07-13 20:36       ` Rick Jones
2011-07-13 22:28         ` Chris Friesen
2011-07-14 14:55       ` Chris Friesen
2011-07-14 16:45         ` Rick Jones
2011-07-14 17:33           ` Chris Friesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).