示例#1
0
func (alloc *Allocator) sendSpaceRequest(dest router.PeerName, r address.Range) {
	buf := new(bytes.Buffer)
	enc := gob.NewEncoder(buf)
	if err := enc.Encode(r); err != nil {
		panic(err)
	}
	msg := router.Concat([]byte{msgSpaceRequest}, buf.Bytes())
	alloc.gossip.GossipUnicast(dest, msg)
}
示例#2
0
func (alloc *Allocator) sendRingUpdate(dest router.PeerName) {
	msg := router.Concat([]byte{msgRingUpdate}, alloc.encode())
	alloc.gossip.GossipUnicast(dest, msg)
}
示例#3
0
文件: allocator.go 项目: binhnv/weave
func (alloc *Allocator) sendSpaceRequestDenied(dest router.PeerName, r address.Range) error {
	msg := router.Concat([]byte{msgSpaceRequestDenied}, encodeRange(r))
	return alloc.gossip.GossipUnicast(dest, msg)
}