MCPcopy
hub / github.com/canopy-network/canopy / sendPacket

Method sendPacket

p2p/conn.go:386–398  ·  view source on GitHub ↗

sendPacket() a rate limited writer of outbound bytes to the wire wraps a proto.Message into a universal Envelope, then converts to bytes and sends them across the wire without violating the data flow rate limits message may be a Packet, a Ping or a Pong

(packet *Packet, m *limiter.Monitor)

Source from the content-addressed store, hash-verified

384// sends them across the wire without violating the data flow rate limits
385// message may be a Packet, a Ping or a Pong
386func (c *MultiConn) sendPacket(packet *Packet, m *limiter.Monitor) {
387 if packet != nil {
388 //c.log.Debugf("Send Packet to %s (ID:%s, L:%d, E:%t), hash: %s",
389 // lib.BytesToTruncatedString(c.Address.PublicKey),
390 // lib.Topic_name[int32(packet.StreamId)],
391 // len(packet.Bytes),
392 // packet.Eof,
393 // crypto.ShortHashString(packet.Bytes),
394 //)
395 }
396 // send packet as message over the wire
397 c.sendWireBytes(packet, m)
398}
399
400// sendWireBytes() a rate limited writer of outbound bytes to the wire
401// wraps a proto.Message into a universal Envelope, then converts to bytes and

Callers

nothing calls this directly

Calls 1

sendWireBytesMethod · 0.95

Tested by

no test coverage detected