Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #58191

getpeername() on stdin?

From Roy Smith <roy@panix.com>
Date 2013-10-31 12:16 -0400
Subject getpeername() on stdin?
Newsgroups comp.lang.python
Message-ID <mailman.1885.1383236191.18130.python-list@python.org> (permalink)

Show all headers | View raw


I want to do getpeername() on stdin.  I know I can do this by wrapping a socket object around stdin, with

s = socket.fromfd(sys.stdin.fileno(), family, type)

but that requires that I know what the family and type are.   What I want to do is discover the family and type by looking at what getpeername() and/or getsockname() return.  Can this be done with the standard library?

---
Roy Smith
roy@panix.com


Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

getpeername() on stdin? Roy Smith <roy@panix.com> - 2013-10-31 12:16 -0400
  Re: getpeername() on stdin? Nobody <nobody@nowhere.com> - 2013-11-01 01:12 +0000
    Re: getpeername() on stdin? random832@fastmail.us - 2013-11-01 14:55 -0400
      Re: getpeername() on stdin? Roy Smith <roy@panix.com> - 2013-11-01 20:26 -0400
      Re: getpeername() on stdin? Nobody <nobody@nowhere.com> - 2013-11-03 03:27 +0000

csiph-web