| 98 | } |
| 99 | |
| 100 | bool memcache::open(void) |
| 101 | { |
| 102 | if (opened_) { |
| 103 | return true; |
| 104 | } |
| 105 | |
| 106 | conn_ = NEW socket_stream(); |
| 107 | |
| 108 | if (!conn_->open(addr_, conn_timeout_, rw_timeout_)) { |
| 109 | logger_error("connect %s error(%s)", addr_, last_serror()); |
| 110 | delete conn_; |
| 111 | conn_ = NULL; |
| 112 | opened_ = false; |
| 113 | ebuf_.format("connect server(%s) error(%s)", |
| 114 | addr_, acl_last_serror()); |
| 115 | return false; |
| 116 | } |
| 117 | opened_ = true; |
| 118 | return true; |
| 119 | } |
| 120 | |
| 121 | bool memcache::set(const string& key, const void* dat, size_t dlen, |
| 122 | time_t timeout, unsigned short flags) |
nothing calls this directly
no test coverage detected