// 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) }
func (cr *connectionReader) readServer() { cr.read(func(seg *capn.Segment) bool { msg := msgs.ReadRootMessage(seg) return cr.enqueueQuery((*connectionReadMessage)(&msg)) }) }