; s cCs ||_dS(sSpecify the node name for the node NODE-NAME = string Must be on the form alivename@hostname Sets the nodes name. This is the node name that is published in the EPMD. N(snodeNamesselfs _ownNodeName(sselfsnodeName((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pysSetOwnNodeNameJscCst||_||_t|_|ii|i|i  o dn|i |i t ddf|i d|idS(sConnect to the EPMD and issue an Alive2 request. CONNECTED-CB = CREATION = integer CONNECT-FAILED-CB = RESULT = integer Connects to the EPMD specified in the constructor, then publishes the own node name and port by issuing an Alive2 request. The SetOwnPortNum and SetOwnNodeName methods must have been called prior to calling this method. sConnection to EPMD failedisN(s connectedCbsselfs _connectedCbsconnectFailedCbs_connectFailedCbsErlEPMDStdConnections _epmdConnsConnects _hostNames_portNums Alive2Reqs _ownPortNumsNODETYPE_HIDDENs _ownNodeNames _Alive2RespCb(sselfs connectedCbsconnectFailedCb((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pysConnectWs     cCs|i|idS(s!Close the connection to the EPMD.N(sselfs AliveCloseReqs_AliveCloseSink(sself((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pysClosemscCs|ii|||dS(sRIssue an Alive request. PORT-NUM = integer The port number of the socket that serves incoming connections to the node. NODE-NAME = string the name of the node (on the form alive@host) This request has no callback. N(sselfs _epmdConnsAliveReqsportNumsnodeNamescb(sselfsportNumsnodeNamescb((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pysAliveReqts cCs#|ii||||||dS(sIssue an Alive2 request. PORT-NUM = integer The port number of the socket that serves incoming connections to the node. NODE-TYPE = integer DISTR-VSN-RANGE = tuple(LO, HI) LO = HI = integer NODE-NAME = string the name of the node (on the form alive@host) EXTRA = string CB = CREATION = integer Calls the callback CB when the answer is available. See the file distribution_handshake.txt in the erlang distribution for more info on the NODE-TYPE, DISTR-VSN-RANGE and EXTRA arguments. N( sselfs _epmdConns Alive2ReqsportNumsnodeTypes distrVSNRangesnodeNamesextrascb(sselfsportNumsnodeTypes distrVSNRangesnodeNamesextrascb((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys Alive2ReqscCs|ii|dS(sIssue an AliveClose request. CB = This effectively closes the socket connection to the EPMD. N(sselfs _epmdConns AliveCloseReqscb(sselfscb((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys AliveCloseReqscCs)t|i|i}|i||dS(sIssue a PortPlease request. NODE-NAME = string CALLBACK = PORT-NUMBER = integer Calls the CALLBACK function with argument PORT-NUMBER when the answer is available. N(sErlEPMDOneShotConnectionsselfs _hostNames_portNumses PortPleaseReqsnodeNamescallback(sselfsnodeNamescallbackse((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys PortPleaseReqscCs)t|i|i}|i||dS(sVIssue a PortPlease2 request. NODE-NAME = string CALLBACK = RESULT = 1 | 0 NODE-TYPE = integer PROTOCOL = integer DISTR-VSN-RANGE = tuple(LO, HI) LO = HI = integer RNODE-NAME = string EXTRA = string Calls the CALLBACK function when the answer is available from the EPMD. If the RESULT is 0, then the values of the rest of the arguments are undefined. If the result is 1, then the rest of the arguments have the values as reported from the EPMD. Calls the CALLBACK function with argument PORT-NUMBER when the answer is available. N(sErlEPMDOneShotConnectionsselfs _hostNames_portNumsesPortPlease2ReqsnodeNamescallback(sselfsnodeNamescallbackse((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pysPortPlease2ReqscCs&t|i|i}|i|dS(sIssue a Names request CALLBACK = PORT-NUMBER = integer Calls the CALLBACK function with argument PORT-NUMBER when the answer is available. N( sselfsPackInt1s_PORT_PLEASE_REQsnodeNamesmsgs erl_commonsCallbacks_UnpackPortPleaseRespscallbacksunpackcbs_SendOneShotReq(sselfsnodeNamescallbacksunpackcbsmsg((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys PortPleaseReq scCs?|i|i|}ti|i|}|i ||dS(sVIssue a PortPlease2 request. NODE-NAME = string CALLBACK = RESULT = 1 | 0 NODE-TYPE = integer PROTOCOL = integer DISTR-VSN-RANGE = tuple(LO, HI) LO = HI = integer RNODE-NAME = string EXTRA = string Calls the CALLBACK function when the answer is available from the EPMD. If the RESULT is 0, then the values of the rest of the arguments are undefined. If the result is 1, then the rest of the arguments have the values as reported from the EPMD. Calls the CALLBACK function with argument PORT-NUMBER when the answer is available. N( sselfsPackInt1s_PORT_PLEASE2_REQsnodeNamesmsgs erl_commonsCallbacks_UnpackPortPlease2Respscallbacksunpackcbs_SendOneShotReq(sselfsnodeNamescallbacksunpackcbsmsg((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pysPortPlease2ReqscCs;|i|i}ti|i|}|i ||dS(sIssue a Names request CALLBACK = |i|d| d| d!}|i|d| d}|| || | |||dS( Niiiiiii i iis(slensrespsselfsReadInt1sresultscbsNonesressReadInt2sportNumsnodeTypesprotocols distrVSNLos distrVSNHis distrVSNRngsnLensnodeNamesextraseLen(sselfsrespscbseLens distrVSNHisportNumsnodeNamesextras distrVSNRngsnLensresultsressprotocolsnodeTypes distrVSNLo((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys_UnpackPortPlease2Respzs"  5 "cCs:|i|dd!}|i|d}|||dS(Nii(sselfsReadInt4sresps epmdPortNumsnodeInfoscb(sselfsrespscbsnodeInfos epmdPortNum((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys_UnpackNamesRespscCs:|i|dd!}|i|d}|||dS(Nii(sselfsReadInt4sresps epmdPortNumsnodeInfoscb(sselfsrespscbsnodeInfos epmdPortNum((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys_UnpackDumpRespscCs||dS(N(scbsresp(sselfsrespscb((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys_UnpackKillRespscCs||dS(N(scbsresp(sselfsrespscb((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys_UnpackStopResps(s__name__s __module__s__doc__s_PORT_PLEASE_REQs_PORT_PLEASE2_REQs _NAMES_REQs _DUMP_REQs _KILL_REQs _STOP_REQs _PORT2_RESPs__init__s PortPleaseReqsPortPlease2ReqsNamesReqsDumpReqsKillReqsStopReqs_SendOneShotReqs_Ins_UnpackPortPleaseResps_UnpackPortPlease2Resps_UnpackNamesResps_UnpackDumpResps_UnpackKillResps_UnpackStopResp(((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pysErlEPMDOneShotConnections.         sErlEPMDStdConnectioncBstZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZRS(s9This class is intended to be used by the instances of the ErlEPMD class. This class provides a long-lasting connection to the Erlang Portmapper Daemon, EPMD. This type of connection is used for ALIVE and ALIVE2 requests, where the connection is expected to live as long as the node is alive. iaixiYiycCs&tii|g|_d|_dS(s Constructor.sN(serl_async_connsErlAsyncClientConnections__init__sselfs_currentRequestss _pendingInput(sself((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys__init__s c Csti|dd}|i|i|i||i||id|i|d|i|d|it |||it ||}|i||dS(sIssue an Alive2 request. PORT-NUM = integer The port number of the socket that serves incoming connections to the node. NODE-TYPE = integer DISTR-VSN-RANGE = tuple(LO, HI) LO = HI = integer NODE-NAME = string the name of the node (on the form alive@host) EXTRA = string CB = CREATION = integer Calls the callback CB when the answer is available. See the file distribution_handshake.txt in the erlang distribution for more info on the NODE-TYPE, DISTR-VSN-RANGE and EXTRA arguments. s@iiN(sstringssplitsnodeNames aliveNamesselfsPackInt1s _ALIVE2_REQsPackInt2sportNumsnodeTypes distrVSNRangeslensextrasmsgs_SendReqscb( sselfsportNumsnodeTypes distrVSNRangesnodeNamesextrascbs aliveNamesmsg((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys Alive2ReqscCs7|i|i|i||}|i|tdS(sRIssue an Alive request. PORT-NUM = integer The port number of the socket that serves incoming connections to the node. NODE-NAME = string the name of the node (on the form alive@host) This request has no callback. N( sselfsPackInt1s _ALIVE_REQsPackInt2sportNumsnodeNamesmsgs_SendReqscb(sselfsportNumsnodeNamesmsg((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pysAliveReqs #cCs|i|dS(sIssue an AliveClose request. CB = This effectively closes the socket connection to the EPMD. N(sselfsClosescb(sselfscb((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys AliveCloseReqs cCsY|i o dn|it|d||it||}|i |dS(Nsnot connected to epmdi( sselfs _isConnecteds _NewCurrReqsordsreqscbsPackInt2slensmsgsSend(sselfsreqscbsmsg((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys_SendReqs   cCs|ii||fdS(N(sselfs_currentRequestssappendsreqIdscb(sselfsreqIdscb((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys _NewCurrReqscCs1t|idjotSn|iddSdS(Ni(slensselfs_currentRequestssNone(sself((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys _GetCurrReqIdscCs1t|idjotSn|iddSdS(Nii(slensselfs_currentRequestssNone(sself((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys _GetCurrReqCb scCs|id|_dS(Ni(sselfs_currentRequests(sself((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys _CurrReqDonescCssd}|iid}t|djo d}n|i|}|i|}||_|o|i ndS(Niii( s is_closedsselfs _connectionsrecvsdataslens _pendingInputsnewInputs _HandleMsgssnewPendingInputs_OtherEndClosedConnection(sselfsnewPendingInputsnewInputsdatas is_closed((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys_Ins   cCsF|i|ijo|i|in |i|idS(N(sselfs _GetCurrReqIds _ALIVE_REQsAliveNotOkResps _CurrReqDonesConnectionClosedsClose(sself((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys_OtherEndClosedConnection+s   cCsN|}xAno9|i|\}}| o|Sn |i|}qWdS(Ni(sinputs toBeUnpackedsselfs _HandleMsgsparsedOksremainingInputs _CurrReqDone(sselfsinputs toBeUnpackedsremainingInputsparsedOk((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys _HandleMsgs5s cCst|}|djod|fSnt|d}||ijo|i|ijoc|djod|fSn|i |dd!}|i }|||i d|dfSn||ijo|i|ijoy|djod|fSn|i|d}|i |dd!}|i }||||i d|dfSnd|i }titd||ddfSdS( Niiiiiscurrent request is %ssunexpected msg, trown away, s(slensdatasdataLensordsdata0sselfs_ALIVE_OK_RESPs _GetCurrReqIds _ALIVE_REQsReadInt2screations _GetCurrReqCbscbs _CurrReqDones _ALIVE2_RESPs _ALIVE2_REQsReadInt1sresults currReqTxts erl_commonsDebugHexsM(sselfsdatascbscreations currReqTxtsdataLensresultsdata0((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys _HandleMsg@s0  &    &    (s__name__s __module__s__doc__s _ALIVE_REQs _ALIVE2_REQs_ALIVE_OK_RESPs _ALIVE2_RESPs__init__s Alive2ReqsAliveReqs AliveCloseReqs_SendReqs _NewCurrReqs _GetCurrReqIds _GetCurrReqCbs _CurrReqDones_Ins_OtherEndClosedConnections _HandleMsgss _HandleMsg(((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pysErlEPMDStdConnections$           (ssysstypessstringssocketsgetopts erl_commonserl_async_connserl_eventhandlersNODETYPE_NORMALsNODETYPE_HIDDENsMsErlEpmdsErlAsyncClientConnectionsErlEPMDOneShotConnectionsErlEPMDStdConnection(serl_eventhandlersstringsNODETYPE_HIDDENserl_async_connsMsErlEPMDStdConnectionssyssNODETYPE_NORMALsErlEpmdsgetopts erl_commonsErlEPMDOneShotConnectionstypesssocket((sL/mnt/gmirror/ports/devel/py_otp_interface/work/py_interface-0.93/erl_epmd.pys?s