예제 #1
0
// Sends a direct message to a known node.
func (o *Overlay) Direct(dest *big.Int, msg *proto.Message) error {
	if err := msg.Encrypt(); err != nil {
		return err
	}
	o.sendDirect(dest, msg)
	return nil
}
예제 #2
0
// Balances a message to one of the subscribed nodes.
func (o *Overlay) Balance(topic string, msg *proto.Message) error {
	if err := msg.Encrypt(); err != nil {
		return err
	}
	o.sendBalance(pastry.Resolve(topic), msg)
	return nil
}