Example #1
0
// paxos.Connection interface to allow sending to ourself.
func (cm *ConnectionManager) Send(b []byte) {
	seg, _, err := capn.ReadFromMemoryZeroCopy(b)
	server.CheckFatal(err)
	msg := msgs.ReadRootMessage(seg)
	cm.DispatchMessage(cm.RMId, msg.Which(), &msg)
}
Example #2
0
func (cr *connectionReader) readServer() {
	cr.read(func(seg *capn.Segment) bool {
		msg := msgs.ReadRootMessage(seg)
		return cr.enqueueQuery((*connectionReadMessage)(&msg))
	})
}