Beispiel #1
0
 def send(self, proto, destPid, msg):
     """
     Common routine to reply to a request.
     """
     cookie = Atom('')
     ctrlMsg = Tuple((Integer(self.CTRLMSGOP_SEND), cookie, destPid))
     proto.send("p" + termToBinary(ctrlMsg) + termToBinary(msg))
Beispiel #2
0
 def namedSend(self, proto, pid, processName, msg):
     """
     Send a message to a named process.
     """
     cookie = Atom('')
     ctrlMsg = Tuple(
         (Integer(self.CTRLMSGOP_REG_SEND), pid, cookie, processName))
     proto.send("p" + termToBinary(ctrlMsg) + termToBinary(msg))
Beispiel #3
0
 def sendLinkExit(self, proto, srcPid, destPid, reason):
     """
     Send an exit signal for a remote linked process.
     """
     ctrlMsg = Tuple(
         (Integer(self.CTRLMSGOP_EXIT), srcPid, destPid, reason))
     proto.send("p" + termToBinary(ctrlMsg))
Beispiel #4
0
 def sendUnlink(self, proto, srcPid, destPid):
     """
     Remove a previously created link between local PID C{srcPid} to remote
     PID C{destPid}.
     """
     ctrlMsg = Tuple((Integer(self.CTRLMSGOP_UNLINK), srcPid, destPid))
     proto.send("p" + termToBinary(ctrlMsg))
Beispiel #5
0
 def sendMonitorExit(self, proto, srcPid, destPid, monitorRef, reason):
     """
     Send a monitor exit signal for a remote process.
     """
     ctrlMsg = Tuple(
         (Integer(self.CTRLMSGOP_MONITOR_P_EXIT), srcPid, destPid,
          monitorRef, reason))
     proto.send("p" + termToBinary(ctrlMsg))
Beispiel #6
0
    def sendDemonitor(self, proto, srcPid, destPid, monitorRef):
        """
        Remove monitoring of remote process C{destPid}.

        @return: the L{Reference} of the monitoring, which will be passed in
            exit.
        """
        ctrlMsg = Tuple(
            (Integer(self.CTRLMSGOP_DEMONITOR_P), srcPid, destPid, monitorRef))
        proto.send("p" + termToBinary(ctrlMsg))
Beispiel #7
0
    def sendMonitor(self, proto, srcPid, destPid):
        """
        Monitor remote PID C{destPid}.

        @return: the L{Reference} of the monitoring, which will be passed in
            exit.
        """
        monitorRef = self.createRef()
        ctrlMsg = Tuple(
            (Integer(self.CTRLMSGOP_MONITOR_P), srcPid, destPid, monitorRef))
        proto.send("p" + termToBinary(ctrlMsg))
        return monitorRef
Beispiel #8
0
 def sendLink(self, proto, srcPid, destPid):
     """
     Create a link from local PID C{srcPid} to remote PID C{destPid}.
     """
     ctrlMsg = Tuple((Integer(self.CTRLMSGOP_LINK), srcPid, destPid))
     proto.send("p" + termToBinary(ctrlMsg))