From: Rick Jones <rick.jones2@hp.com>
To: Chris Friesen <chris.friesen@genband.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>, netdev@vger.kernel.org
Subject: Re: any way to let host act as TCP server OR client on same IP/port?
Date: Thu, 14 Jul 2011 09:45:46 -0700 [thread overview]
Message-ID: <4E1F1D3A.1030204@hp.com> (raw)
In-Reply-To: <4E1F0345.8020108@genband.com>
>> In our case we don't need to actually be connected, just be listening
>> and ready to either accept() a connection or connect() to someone else.
>
> It turns out that the application people really do want the server side
> to be able to listen() at the same time as calling connect() from the
> same address/port, so Rick's testcase was accurate.
So, we are left asking "Why do the application people want that?" Does
the server connect() to pseudo-random places, or does it only ever
connect back to clients which have already connected to it?
If the desire is to have the same well-known port number involved in all
connections to/from the server (perhaps for simplistic firewall rules
involving serverip.magicport?) then if the connections are back to the
clients, the clients could simply open listen endpoints bound to the
magic port number and the firewall rule become "server IP is source or
destination) AND (magic port is source or destination)" - assuming the
clients aren't bind()ing to the magic port number before connect()ing to
the server.
rick jones
next prev parent reply other threads:[~2011-07-14 16:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2011-07-14 17:33 ` Chris Friesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E1F1D3A.1030204@hp.com \
--to=rick.jones2@hp.com \
--cc=chris.friesen@genband.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).