All Samples(645) | Call(641) | Derive(0) | Import(4)
getaddrinfo(host, port [, family, socktype, proto, flags])
-> list of (family, socktype, proto, canonname, sockaddr)
Resolve host and port into addrinfo struct.src/b/r/braintree_python_examples-HEAD/tr_checkout_app_engine/web/wsgiserver/__init__.py braintree_python_examples(Download)
# Get the correct address family for our host (allows IPv6 addresses)
host, port = self.bind_addr
try:
info = socket.getaddrinfo(host, port, socket.AF_UNSPEC,
socket.SOCK_STREAM, 0, socket.AI_PASSIVE)
except socket.gaierror:
# Probably a DNS issue. Assume IPv4.
# here, because we want an actual IP to touch.
# localhost won't work if we've bound to a public IP,
# but it will if we bound to '0.0.0.0' (INADDR_ANY).
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
s = None
src/p/y/pypak-HEAD/trunk/examples/loggerd/PC/ftirlib.py pypak(Download)
def open_socket(Host, Port, Timeout = 5):
# Host: Remote host IP address or name
# Port: TCP/IP port
# Timeout: Socket timeout
import socket
for res in socket.getaddrinfo(Host, Port, socket.AF_UNSPEC, socket.SOCK_STREAM):
src/p/y/pypak-HEAD/examples/loggerd/PC/ftirlib.py pypak(Download)
def open_socket(Host, Port, Timeout = 5):
# Host: Remote host IP address or name
# Port: TCP/IP port
# Timeout: Socket timeout
import socket
for res in socket.getaddrinfo(Host, Port, socket.AF_UNSPEC, socket.SOCK_STREAM):
src/g/a/gajim-HEAD/src/common/zeroconf/client_zeroconf.py gajim(Download)
def bind(self): flags = socket.AI_PASSIVE if hasattr(socket, 'AI_ADDRCONFIG'): flags |= socket.AI_ADDRCONFIG ai = socket.getaddrinfo(None, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, flags)[0] self._serv = socket.socket(ai[0], ai[1])
else:
self.state = 0
try:
self.ais = socket.getaddrinfo(host, port, socket.AF_UNSPEC,
socket.SOCK_STREAM)
except socket.gaierror, e:
log.info('Lookup failure for %s: %s[%s]', host, e[1], repr(e[0]),
src/g/a/gajim-HEAD/src/common/socks5.py gajim(Download)
def __init__(self, idlequeue, host, port, initiator, target, sid): if host is not None: try: self.host = host self.ais = socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM) except socket.gaierror: self.ais = None
def __init__(self, idlequeue, port): ''' handle all incomming connections on (0.0.0.0, port) This class implements IdleObject, but we will expect only pollin events though ''' self.port = port self.ais = socket.getaddrinfo(None, port, socket.AF_UNSPEC,
src/j/y/jython-HEAD/sandbox/tobias/jython/CPythonLib/ftplib.py jython(Download)
if host: self.host = host
if port: self.port = port
msg = "getaddrinfo returns an empty list"
for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
try:
self.sock = socket.socket(af, socktype, proto)
def makeport(self):
'''Create a new socket and send a PORT command for it.'''
msg = "getaddrinfo returns an empty list"
sock = None
for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
af, socktype, proto, canonname, sa = res
try:
size = None
if self.passiveserver:
host, port = self.makepasv()
af, socktype, proto, canon, sa = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)[0]
conn = socket.socket(af, socktype, proto)
conn.connect(sa)
if rest is not None:
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/ftplib.py ironruby(Download)
def makeport(self):
'''Create a new socket and send a PORT command for it.'''
msg = "getaddrinfo returns an empty list"
sock = None
for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
af, socktype, proto, canonname, sa = res
try:
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/ftplib.py ironruby(Download)
def makeport(self):
'''Create a new socket and send a PORT command for it.'''
msg = "getaddrinfo returns an empty list"
sock = None
for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
af, socktype, proto, canonname, sa = res
try:
src/j/y/jython-HEAD/jython/CPythonLib/ftplib.py jython(Download)
if host: self.host = host
if port: self.port = port
msg = "getaddrinfo returns an empty list"
for res in socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
try:
self.sock = socket.socket(af, socktype, proto)
def makeport(self):
'''Create a new socket and send a PORT command for it.'''
msg = "getaddrinfo returns an empty list"
sock = None
for res in socket.getaddrinfo(None, 0, self.af, socket.SOCK_STREAM, 0, socket.AI_PASSIVE):
af, socktype, proto, canonname, sa = res
try:
size = None
if self.passiveserver:
host, port = self.makepasv()
af, socktype, proto, canon, sa = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)[0]
conn = socket.socket(af, socktype, proto)
conn.connect(sa)
if rest is not None:
src/s/h/shot-o-matic-HEAD/vendor/tornado-0.2/demos/wsgi/web/wsgiserver/__init__.py shot-o-matic(Download)
# Get the correct address family for our host (allows IPv6 addresses)
host, port = self.bind_addr
try:
info = socket.getaddrinfo(host, port, socket.AF_UNSPEC,
socket.SOCK_STREAM, 0, socket.AI_PASSIVE)
except socket.gaierror:
# Probably a DNS issue. Assume IPv4.
# here, because we want an actual IP to touch.
# localhost won't work if we've bound to a public IP,
# but it will if we bound to '0.0.0.0' (INADDR_ANY).
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
s = None
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next