(buf []byte)
| 50 | } |
| 51 | |
| 52 | func (t *TCPClient) Write(buf []byte) error { |
| 53 | if conn := t.getConn(); conn != nil { |
| 54 | _, err := conn.Write(buf) |
| 55 | if err != nil { |
| 56 | t.unexpectedClose(err) |
| 57 | return ErrConnectionClosed |
| 58 | } |
| 59 | return nil |
| 60 | } |
| 61 | |
| 62 | return ErrConnectionClosed |
| 63 | } |
| 64 | |
| 65 | func (t *TCPClient) ReadBytes(l int) ([]byte, error) { |
| 66 | buf := make([]byte, l) |
no test coverage detected