(bytesC chan []byte)
| 405 | } |
| 406 | |
| 407 | func (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 | |
| 426 | func (c *client) decodePipe(bytesC chan []byte) (replyMsg, receivedMsg chan P2PMessage) { |
| 427 | replyMsg = make(chan P2PMessage) |
no test coverage detected