| 40 | } |
| 41 | |
| 42 | bool tcp_client::try_open(bool* reuse_conn) |
| 43 | { |
| 44 | if (conn_->opened()) { |
| 45 | *reuse_conn = true; |
| 46 | return true; |
| 47 | } |
| 48 | |
| 49 | *reuse_conn = false; |
| 50 | if (!conn_->open(addr_, conn_timeout_, rw_timeout_)) { |
| 51 | logger_error("connect %s error %s", addr_, last_serror()); |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | bool tcp_client::send(const void* data, unsigned int len, string* out /* = NULL */) |
| 59 | { |
nothing calls this directly
no test coverage detected