MCPcopy Create free account
hub / github.com/DOSNetwork/core / sendPipe

Method sendPipe

p2p/client.go:407–424  ·  view source on GitHub ↗
(bytesC chan []byte)

Source from the content-addressed store, hash-verified

405}
406
407func (c *client) sendPipe(bytesC chan []byte) {
408 go func() {
409 for {
410 select {
411 case <-c.ctx.Done():
412 return
413 case bytes, ok := <-bytesC:
414 if ok {
415 err := writeTo(bytes, c.conn)
416 if err != nil {
417 c.reportError(errors.Errorf("client sendPipe: %w", err))
418 }
419 }
420 }
421 }
422 }()
423 return
424}
425
426func (c *client) decodePipe(bytesC chan []byte) (replyMsg, receivedMsg chan P2PMessage) {
427 replyMsg = make(chan P2PMessage)

Callers 1

runMethod · 0.95

Calls 2

reportErrorMethod · 0.95
writeToFunction · 0.85

Tested by

no test coverage detected