MINI MINI MANI MO

Path : /lib64/python2.7/multiprocessing/
File Upload :
Current File : //lib64/python2.7/multiprocessing/connection.pyo

ó
Fģ]c@sˆdddgZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZddlm
Z
mZmZmZddlmZmZdZd	Zd
ZejƒZdZdgZeedƒrdZedg7Znejd
kr4dZedg7Zned„Zd„Zd„Zd„Z de!fd„ƒYZ"ddd„Z$ejd
krže%d„Z&nddlm'Z'e%d„Z&de!fd„ƒYZ(d„Z)ejd
kr
de!fd„ƒYZ*d„Z+ndZ,dZ-d Z.d!Z/d"„Z0d#„Z1d$„Z2d%e!fd&„ƒYZ3d'„Z4d(„Z5d)e"fd*„ƒYZ6d+„Z7dS(,tClienttListenertPipei’’’’N(tcurrent_processtAuthenticationError(tget_temp_dirtFinalizet	sub_debugtdebug(t	duplicatetclosei g4@tsha256tAF_INETtAF_UNIXtwin32tAF_PIPEcCstjƒ|S(N(ttime(ttimeout((s2/usr/lib64/python2.7/multiprocessing/connection.pyt
_init_timeoutMscCstjƒ|kS(N(R(tt((s2/usr/lib64/python2.7/multiprocessing/connection.pyt_check_timeoutPscCsw|dkrdS|dkr5tjdddtƒƒS|dkrgtjdd	tjƒtjƒfƒStd
ƒ‚dS(
s?
    Return an arbitrary free address for the given family
    Rt	localhostiR
tprefixs	listener-tdirRs\\.\pipe\pyc-%d-%d-sunrecognized familyN(Ri(ttempfiletmktempRtostgetpidt
_mmap_countertnextt
ValueError(tfamily((s2/usr/lib64/python2.7/multiprocessing/connection.pytarbitrary_addressWscCset|ƒtkrdSt|ƒtkr;|jdƒr;dSt|ƒtkrQdStd|ƒ‚dS(s]
    Return the types of the address

    This can be 'AF_INET', 'AF_UNIX', or 'AF_PIPE'
    Rs\\RR
saddress type of %r unrecognizedN(ttypettupletstrt
startswithR(taddress((s2/usr/lib64/python2.7/multiprocessing/connection.pytaddress_typefs!cBsSeZdZddddd„Zd„Zd„Zed„ƒZed„ƒZ	RS(s•
    Returns a listener object.

    This is a wrapper for a bound socket which is 'listening' for
    connections, or for a Windows named pipe.
    icCs›|p|rt|ƒpt}|p-t|ƒ}|dkrQt||ƒ|_nt|||ƒ|_|dk	rŽt|tƒrŽt	d‚n||_
dS(NRsauthkey should be a byte string(R&tdefault_familyR tPipeListenert	_listenertSocketListenertNonet
isinstancetbytest	TypeErrort_authkey(tselfR%Rtbacklogtauthkey((s2/usr/lib64/python2.7/multiprocessing/connection.pyt__init__€scCs?|jjƒ}|jr;t||jƒt||jƒn|S(sz
        Accept a connection on the bound socket or named pipe of `self`.

        Returns a `Connection` object.
        (R)tacceptR/tdeliver_challengetanswer_challenge(R0tc((s2/usr/lib64/python2.7/multiprocessing/connection.pyR4s
	cCs
|jjƒS(sA
        Close the bound socket or named pipe of `self`.
        (R)R
(R0((s2/usr/lib64/python2.7/multiprocessing/connection.pyR
›scCs
|jjS(N(R)t_address(R0((s2/usr/lib64/python2.7/multiprocessing/connection.pyt<lambda>”scCs
|jjS(N(R)t_last_accepted(R0((s2/usr/lib64/python2.7/multiprocessing/connection.pyR9¢sN(
t__name__t
__module__t__doc__R+R3R4R
tpropertyR%t
last_accepted(((s2/usr/lib64/python2.7/multiprocessing/connection.pyRys		cCsŽ|pt|ƒ}|dkr-t|ƒ}nt|ƒ}|dk	rat|tƒratd‚n|dk	rŠt||ƒt||ƒn|S(s=
    Returns a connection to the address of a `Listener`
    Rsauthkey should be a byte stringN(	R&t
PipeClienttSocketClientR+R,R-R.R6R5(R%RR2R7((s2/usr/lib64/python2.7/multiprocessing/connection.pyR„s
cCsĖ|r…tjƒ\}}|jtƒ|jtƒtjtj|jƒƒƒ}tjtj|jƒƒƒ}|j	ƒ|j	ƒn<tj
ƒ\}}tj|dtƒ}tj|dtƒ}||fS(sL
        Returns pair of connection objects at either end of a pipe
        twritabletreadable(tsockett
socketpairtsetblockingtTruet_multiprocessingt
ConnectionRtduptfilenoR
tpipetFalse(tduplexts1ts2tc1tc2tfd1tfd2((s2/usr/lib64/python2.7/multiprocessing/connection.pyR»s



(Rc	CsUtdƒ}|r;tj}tjtjB}tt}}ntj}tj}dt}}tj||tjtj	Btj
Bd||tjtjƒ}tj
||dtjtjdtjƒ}tj|tj	ddƒytj|tjƒWn/tk
r }|jdtjkr!‚q!nXtj|d|ƒ}	tj|d|ƒ}
|	|
fS(sL
        Returns pair of connection objects at either end of a pipe
        RiiRBRCN(R RtPIPE_ACCESS_DUPLEXtGENERIC_READt
GENERIC_WRITEtBUFSIZEtPIPE_ACCESS_INBOUNDtCreateNamedPipetPIPE_TYPE_MESSAGEtPIPE_READMODE_MESSAGEt	PIPE_WAITtNMPWAIT_WAIT_FOREVERtNULLt
CreateFilet
OPEN_EXISTINGtSetNamedPipeHandleStateR+tConnectNamedPipetWindowsErrortargstERROR_PIPE_CONNECTEDRHtPipeConnection(RNR%topenmodetaccesstobsizetibsizeth1th2teRQRR((s2/usr/lib64/python2.7/multiprocessing/connection.pyRŃs2			

$
R*cBs,eZdZdd„Zd„Zd„ZRS(sO
    Representation of a socket which is bound to an address and listening
    icCsötjtt|ƒƒ|_yb|jjtjtjdƒ|jjtƒ|jj|ƒ|jj	|ƒ|jj
ƒ|_Wn$tjk
r£|jj
ƒ‚nX||_d|_|dkrét|tjd|fddƒ|_n	d|_dS(NiR
Retexitpriorityi(RDtgetattrt_sockett
setsockoptt
SOL_SOCKETtSO_REUSEADDRRFRGtbindtlistentgetsocknameR8terrorR
t_familyR+R:RRtunlinkt_unlink(R0R%RR1((s2/usr/lib64/python2.7/multiprocessing/connection.pyR3’s 
		$cCs›x\tr^y|jjƒ\}|_Wn2tjk
rY}|jdtjkr[‚q[qXPqW|j	tƒt
|jƒƒ}tj
|ƒ}|jƒ|S(Ni(RGRqR4R:RDRxReterrnotEINTRRFR	RKRHRIR
(R0tsRntfdtconn((s2/usr/lib64/python2.7/multiprocessing/connection.pyR4s	


cCs-|jjƒ|jdk	r)|jƒndS(N(RqR
R{R+(R0((s2/usr/lib64/python2.7/multiprocessing/connection.pyR
#s
(R;R<R=R3R4R
(((s2/usr/lib64/python2.7/multiprocessing/connection.pyR*ūs	cCsßt|ƒ}tjtt|ƒƒ}|jtƒtƒ}xsy|j|ƒWnXtjk
rØ}|jdt	j
ks…t|ƒr˜td|ƒ‚nt
jdƒq=XPq=‚t|jƒƒ}tj|ƒ}|jƒ|S(sO
    Return a connection object connected to the socket given by `address`
    isfailed to connect to address %sg{®Gįz„?(R&RDRpRFRGRtconnectRxReR|tECONNREFUSEDRRRtsleepR	RKRHRIR
(R%RR~RRnRR€((s2/usr/lib64/python2.7/multiprocessing/connection.pyRA)s$
	"

R(cBs2eZdZdd„Zd„Zed„ƒZRS(s0
        Representation of a named pipe
        c	Cs ||_tj|tjtjtjBtjBtjtttj	tj
ƒ}|g|_d|_
td|jƒt|tjd|j|jfddƒ|_dS(Ns listener created with address=%rReRoi(R8RRZRUR[R\R]tPIPE_UNLIMITED_INSTANCESRXR^R_t
_handle_queueR+R:RRR(t_finalize_pipe_listenerR
(R0R%R1thandle((s2/usr/lib64/python2.7/multiprocessing/connection.pyR3Ns		
	c	CsÅtj|jtjtjtjBtjBtjtttj	tj
ƒ}|jj|ƒ|jj
dƒ}ytj|tj
ƒWn8tk
r·}|jdtjtjfkrø‚qønXtj|ƒS(Ni(RRZR8RUR[R\R]R„RXR^R_R…tappendtpopRcRdReRft
ERROR_NO_DATARHRg(R0t	newhandleR‡Rn((s2/usr/lib64/python2.7/multiprocessing/connection.pyR4as

cCs,td|ƒx|D]}t|ƒqWdS(Ns closing listener with address=%r(RR
(tqueueR%R‡((s2/usr/lib64/python2.7/multiprocessing/connection.pyR†us

N(R;R<R=R+R3R4tstaticmethodR†(((s2/usr/lib64/python2.7/multiprocessing/connection.pyR(Js	cCsČtƒ}x–yHtj|dƒtj|tjtjBdtjtjdtjƒ}WnDtk
rš}|j	dtj
tjfks‘t|ƒrœ‚qœqXPq‚tj
|tjddƒtj|ƒS(sU
        Return a connection object connected to the pipe given by `address`
        ičiN(RRt
WaitNamedPipeR`RVRWR_RaRdRetERROR_SEM_TIMEOUTtERROR_PIPE_BUSYRRbR\R+RHRg(R%RthRn((s2/usr/lib64/python2.7/multiprocessing/connection.pyR@{s 	"
is#CHALLENGE#s	#WELCOME#s	#FAILURE#cCsddl}t|tƒS(Ni’’’’(thashlibRptHMAC_DIGEST_NAME(R’((s2/usr/lib64/python2.7/multiprocessing/connection.pytget_digestmod_for_hmacŸscCs’ddl}tjtƒ}|jt|ƒ|j||tƒƒjƒ}|j	dƒ}||kru|jt
ƒn|jtƒtdƒ‚dS(Ni’’’’isdigest received was wrong(
thmacRturandomtMESSAGE_LENGTHt
send_bytest	CHALLENGEtnewR”tdigestt
recv_bytestWELCOMEtFAILURER(t
connectionR2R•tmessageR›tresponse((s2/usr/lib64/python2.7/multiprocessing/connection.pyR5£s
cCs„ddl}|jdƒ}|ttƒ}|j||tƒƒjƒ}|j|ƒ|jdƒ}|tkr€t	dƒ‚ndS(Ni’’’’isdigest sent was rejected(
R•RœtlenR™RšR”R›R˜RR(RŸR2R•R R›R”((s2/usr/lib64/python2.7/multiprocessing/connection.pyR6°s
tConnectionWrappercBs#eZd„Zd„Zd„ZRS(cCsO||_||_||_x-dD]%}t||ƒ}t|||ƒq"WdS(NRKR
tpollRœR˜(sfilenoscloseR¤s
recv_bytess
send_bytes(t_connt_dumpst_loadsRptsetattr(R0R€tdumpstloadstattrtobj((s2/usr/lib64/python2.7/multiprocessing/connection.pyR3Įs			
cCs#|j|ƒ}|jj|ƒdS(N(R¦R„R˜(R0R¬R~((s2/usr/lib64/python2.7/multiprocessing/connection.pytsendČscCs|jjƒ}|j|ƒS(N(R„RœR§(R0R~((s2/usr/lib64/python2.7/multiprocessing/connection.pytrecvĖs(R;R<R3R­R®(((s2/usr/lib64/python2.7/multiprocessing/connection.pyR£Ąs		cCs%tj|fddddƒjdƒS(Nitutf8(t	xmlrpclibR©R+tencode(R¬((s2/usr/lib64/python2.7/multiprocessing/connection.pyt
_xml_dumpsĻscCs%tj|jdƒƒ\\}}|S(NRÆ(R°RŖtdecode(R~R¬tmethod((s2/usr/lib64/python2.7/multiprocessing/connection.pyt
_xml_loadsŅs!tXmlListenercBseZd„ZRS(cCs+ddlatj|ƒ}t|ttƒS(Ni’’’’(R°RR4R£R²Rµ(R0R¬((s2/usr/lib64/python2.7/multiprocessing/connection.pyR4×s(R;R<R4(((s2/usr/lib64/python2.7/multiprocessing/connection.pyR¶ÖscOs%ddlatt||ŽttƒS(Ni’’’’(R°R£RR²Rµ(Retkwds((s2/usr/lib64/python2.7/multiprocessing/connection.pyt	XmlClientŻs(8t__all__RtsysRDR|RRt	itertoolsRHtmultiprocessingRRtmultiprocessing.utilRRRRtmultiprocessing.forkingR	R
RXtCONNECTION_TIMEOUTR“tcountRR'tfamiliesthasattrtplatformRRR R&tobjectRR+RRGRRR*RAR(R@R—R™RRžR”R5R6R£R²RµR¶Rø(((s2/usr/lib64/python2.7/multiprocessing/connection.pyt<module>#sd"				,*.	1		
			

OHA YOOOO