Example #1
0
File: node.py Project: gbour/twotp
 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))
Example #2
0
File: node.py Project: gbour/twotp
 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))
Example #3
0
File: node.py Project: gbour/twotp
 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))
Example #4
0
File: node.py Project: gbour/twotp
 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))
Example #5
0
File: node.py Project: gbour/twotp
 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))
Example #6
0
File: node.py Project: gbour/twotp
    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))
Example #7
0
File: node.py Project: gbour/twotp
    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
Example #8
0
File: node.py Project: gbour/twotp
 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))