Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #60545 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2013-11-27 09:56 +1100 |
| Last post | 2013-11-27 09:56 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: How to determine whether client and server are on the same host Chris Angelico <rosuav@gmail.com> - 2013-11-27 09:56 +1100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-11-27 09:56 +1100 |
| Subject | Re: How to determine whether client and server are on the same host |
| Message-ID | <mailman.3259.1385506584.18130.python-list@python.org> |
On Wed, Nov 27, 2013 at 4:26 AM, Malte Forkel <malte.forkel@berlin.de> wrote:
> Thanks for the explanation. I guess I was hoping that I could use some
> property of a connection created with telnetlib or its socket to find
> out whether it was actually a host-local connection (i.e. a connection
> to 'localhost', '127.xx.xx.xx' or '<local_host_name>').
>
> So its either your initial suggestion of taking a hint from the user or
> comparing files on the server and the client.
You can still have a unique file, then; all you sacrifice is the
random name generation. And you can of course recognize 127.x.y.z as
local - it's just not the _only_ way to detect a local connection.
Since this is, presumably, an optimization, you could possibly just
tell people that it'll run faster if they tell it 127.0.0.1 than if
they tell it {whatever other IPs the server has}. That may end up
sufficient. Otherwise, yeah, detect by filesystem with a
manually-created file.
ChrisA
Back to top | Article view | comp.lang.python
csiph-web