Read reads the message at the current offset from the connection, advancing the offset on success so the next call to a read method will produce the next message. The method returns the number of bytes read, or an error if something went wrong. While it is safe to call Read concurrently from multip
(b []byte)
| 707 | // This method is provided to satisfy the net.Conn interface but is much less |
| 708 | // efficient than using the more general purpose ReadBatch method. |
| 709 | func (c *Conn) Read(b []byte) (int, error) { |
| 710 | batch := c.ReadBatch(1, len(b)) |
| 711 | n, err := batch.Read(b) |
| 712 | return n, coalesceErrors(silentEOF(err), batch.Close()) |
| 713 | } |
| 714 | |
| 715 | // ReadMessage reads the message at the current offset from the connection, |
| 716 | // advancing the offset on success so the next call to a read method will |