send() sends a message to a specific peer object
(peer *Peer, topic lib.Topic, bz []byte)
| 292 | |
| 293 | // send() sends a message to a specific peer object |
| 294 | func (ps *PeerSet) send(peer *Peer, topic lib.Topic, bz []byte) lib.ErrorI { |
| 295 | //ps.logger.Debugf("Sending %s message to %s", topic, lib.BytesToTruncatedString(peer.Address.PublicKey)) |
| 296 | go func() { |
| 297 | ok := peer.conn.Send(topic, bz) |
| 298 | if !ok { |
| 299 | ps.logger.Errorf("sending %s message to %s failed", topic, lib.BytesToTruncatedString(peer.Address.PublicKey)) |
| 300 | } |
| 301 | }() |
| 302 | return nil |
| 303 | } |
| 304 | |
| 305 | // remove() decrements the in/out counters, and deletes it from the set |
| 306 | func (ps *PeerSet) remove(peer *Peer) { |
no test coverage detected