%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python2.7/site-packages/tornado/platform/
Upload File :
Create Path :
Current File : //lib64/python2.7/site-packages/tornado/platform/caresresolver.pyc

�
��L]c@�s�ddlmZmZmZmZddlZddlZddlmZddl	m
Z
ddlmZm
Z
defd��YZdS(i(tabsolute_importtdivisiontprint_functiontwith_statementN(tgen(tIOLoop(tResolvertis_valid_ipt
CaresResolvercB�sAeZdZdd�Zd�Zd�Zejdd��Z	RS(s>Name resolver based on the c-ares library.

    This is a non-blocking and non-threaded resolver.  It may not produce
    the same results as the system resolver, but can be used for non-blocking
    resolution when threads cannot be used.

    c-ares fails to resolve some names when ``family`` is ``AF_UNSPEC``,
    so it is only recommended for use in ``AF_INET`` (i.e. IPv4).  This is
    the default for ``tornado.simple_httpclient``, but other libraries
    may default to ``AF_UNSPEC``.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.
    cC�s:|ptj�|_tjd|j�|_i|_dS(Nt
sock_state_cb(Rtcurrenttio_looptpycarestChannelt_sock_state_cbtchanneltfds(tselfR((sD/usr/lib64/python2.7/site-packages/tornado/platform/caresresolver.pyt
initializescC�s�|rtjnd|r!tjndB}|sK|jj|�|j|=nX||jkr}|jj||�||j|<n&|jj||j|�||j|<dS(Ni(	RtREADtWRITERtremove_handlerRtupdate_handlertadd_handlert_handle_events(Rtfdtreadabletwritabletstate((sD/usr/lib64/python2.7/site-packages/tornado/platform/caresresolver.pyRs
cC�sUtj}tj}|tj@r(|}n|tj@r>|}n|jj||�dS(N(RtARES_SOCKET_BADRRRRt
process_fd(RRteventstread_fdtwrite_fd((sD/usr/lib64/python2.7/site-packages/tornado/platform/caresresolver.pyR+s		
	
	icc�sft|�r|g}n�|jj||tjd�V�tjd�V}t|tj�s`t�|j	spt�|j
\}}|r�td|tj
j|�|f��n|j}g}x�|D]�}	d|	kr�tj}
n!d|	kr�tj}
n	tj}
|tjkr6||
kr6td||
f��n|j|
|	|ff�q�Wtj|��dS(Nis/C-Ares returned error %s: %s while resolving %st.t:s%Requested socket family %d but got %d(RRt
gethostbynameRtCallbacktWaitt
isinstancet	ArgumentstAssertionErrortkwargstargst	ExceptionRterrnotstrerrort	addressestsockettAF_INETtAF_INET6t	AF_UNSPECtappendtReturn(RthosttporttfamilyR/t
callback_argstresultterrortaddrinfotaddresstaddress_family((sD/usr/lib64/python2.7/site-packages/tornado/platform/caresresolver.pytresolve4s. "	
	N(
t__name__t
__module__t__doc__tNoneRRRRt	coroutineR?(((sD/usr/lib64/python2.7/site-packages/tornado/platform/caresresolver.pyR
s	
		(t
__future__RRRRRR0ttornadoRttornado.ioloopRttornado.netutilRRR(((sD/usr/lib64/python2.7/site-packages/tornado/platform/caresresolver.pyt<module>s"

Zerion Mini Shell 1.0