Commit 7838982c authored by Michael Graff's avatar Michael Graff
Browse files

add reply() function, and return the sequence numbers

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@138 e5f2f494-b856-4b98-b285-d166d9295462
parent ea3adb92
......@@ -114,15 +114,17 @@ class Session:
})
def group_sendmsg(self, msg, group, instance = "*", to = "*"):
seq = self._next_sequence()
self.sendmsg({
"type": "send",
"from": self._lname,
"to": to,
"group": group,
"instance": instance,
"seq": self._next_sequence(),
"seq": seq,
"msg": Message.to_wire(msg),
})
return seq
def group_recvmsg(self, nonblock = True):
msg = self.recvmsg(nonblock)
......@@ -131,6 +133,20 @@ class Session:
data = Message.from_wire(msg["msg"])
return (data, msg)
def group_reply(self, routing, msg):
seq = self._next_sequence()
self.sendmsg({
"type": "send",
"from": self._lname,
"to": routing["from"],
"group": routing["group"],
"instance": routing["instance"],
"seq": seq,
"reply": routing["seq"],
"msg": Message.to_wire(msg),
})
return seq
if __name__ == "__main__":
import doctest
doctest.testmod()
......@@ -115,14 +115,30 @@ class Session
end
def group_sendmsg(msg, group, instance = "*", to = "*")
seq = next_sequence
sendmsg({ :type => "send",
:from => @lname,
:to => to,
:group => group,
:instance => instance,
:seq => next_sequence,
:seq => seq,
:msg => CC::Message.to_wire(msg),
})
seq
end
def group_sendmsg(routing, msg)
seq = next_sequence
sendmsg({ :type => "send",
:from => @lname,
:to => routing["from"],
:group => routing["group"],
:instance => routing["instance"],
:seq => seq,
:reply => fouring["seq"],
:msg => CC::Message.to_wire(msg),
})
seq
end
def group_recvmsg(nonblock = true)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment