readFull ensures the conn ReadDeadline has been setup before making a call to io.ReadFull
(buf []byte)
| 1048 | // readFull ensures the conn ReadDeadline has been setup before making a |
| 1049 | // call to io.ReadFull |
| 1050 | func (b *Broker) readFull(buf []byte) (n int, err error) { |
| 1051 | if err := b.conn.SetReadDeadline(time.Now().Add(b.conf.Net.ReadTimeout)); err != nil { |
| 1052 | return 0, err |
| 1053 | } |
| 1054 | |
| 1055 | return io.ReadFull(b.conn, buf) |
| 1056 | } |
| 1057 | |
| 1058 | // write ensures the conn Deadline has been setup before making a |
| 1059 | // call to conn.Write |
no test coverage detected