Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / urllib3 / util / connection.pyc
Size: Mime:
ó
èEYc@@s‹ddlmZddlZddlmZddlmZmZd„Zej	ddd„Zd„Zd	„Z
d
„ZedƒZdS(i(tabsolute_importNi(t
wait_for_read(t
HAS_SELECTt
SelectorErrorcC@sot|dtƒ}|tkr"tS|dkr2tSts<tSytt|ddƒƒSWntk
rjtSXdS(s 
    Returns True if the connection is dropped and should be closed.

    :param conn:
        :class:`httplib.HTTPConnection` object.

    Note: For platforms like AppEngine, this will always return ``False`` to
    let the platform handle connection recycling transparently for us.
    tsockttimeoutgN(tgetattrtFalsetNonetTrueRtboolRR(tconnR((sL/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/util/connection.pytis_connection_droppeds

cC@sO|\}}|jdƒr-|jdƒ}nd}tƒ}xètj|||tjƒD]Ë}|\}	}
}}}
d}yltj|	|
|ƒ}t||ƒ|tjk	r½|j	|ƒn|rÓ|j
|ƒn|j|
ƒ|SWqXtjk
r"}|}|dk	r#|j
ƒd}q#qXXqXW|dk	r<|‚ntjdƒ‚dS(sdConnect to *address* and return the socket object.

    Convenience function.  Connect to *address* (a 2-tuple ``(host,
    port)``) and return the socket object.  Passing the optional
    *timeout* parameter will set the timeout on the socket instance
    before attempting to connect.  If no *timeout* is supplied, the
    global default timeout setting returned by :func:`getdefaulttimeout`
    is used.  If *source_address* is set it must be a tuple of (host, port)
    for the socket to bind as a source address before making the connection.
    An host of '' or port 0 tells the OS to use the default.
    t[s[]s!getaddrinfo returns an empty listN(t
startswithtstripRtallowed_gai_familytsockettgetaddrinfotSOCK_STREAMt_set_socket_optionst_GLOBAL_DEFAULT_TIMEOUTt
settimeouttbindtconnectterrortclose(taddressRtsource_addresstsocket_optionsthosttportterrtfamilytrestaftsocktypetprotot	canonnametsaRte((sL/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/util/connection.pytcreate_connection$s2	"


	cC@s2|dkrdSx|D]}|j|ŒqWdS(N(Rt
setsockopt(Rtoptionstopt((sL/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/util/connection.pyRXs
cC@stj}trtj}n|S(s³This function is designed to work in the context of
    getaddrinfo, where family=socket.AF_UNSPEC is the default and
    will perform a DNS search for both IPv6 and IPv4 records.(RtAF_INETtHAS_IPV6t	AF_UNSPEC(R!((sL/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/util/connection.pyR`s	cC@srd}t}tjr[y/tjtjƒ}|j|dfƒt}Wq[tk
rWq[Xn|rn|jƒn|S(s6 Returns True if the system can bind an IPv6 address. iN(	RRRthas_ipv6tAF_INET6RR	t	ExceptionR(RRR0((sL/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/util/connection.pyt	_has_ipv6ks	


s::1(t
__future__RRtwaitRt	selectorsRRRRRR)RRR3R.(((sL/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/util/connection.pyt<module>s	3