MCPcopy Create free account
hub / github.com/apache/brpc / ~SocketMap

Method ~SocketMap

src/brpc/socket_map.cpp:151–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151SocketMap::~SocketMap() {
152 RPC_VLOG << "Destroying SocketMap=" << this;
153 if (_has_close_idle_thread) {
154 bthread_stop(_close_idle_thread);
155 bthread_join(_close_idle_thread, NULL);
156 }
157 if (!_map.empty()) {
158 std::ostringstream err;
159 int nleft = 0;
160 for (Map::iterator it = _map.begin(); it != _map.end(); ++it) {
161 SingleConnection* sc = &it->second;
162 if ((!sc->socket->Failed() ||
163 sc->socket->HCEnabled()) &&
164 sc->ref_count != 0) {
165 ++nleft;
166 if (nleft == 0) {
167 err << "Left in SocketMap(" << this << "):";
168 }
169 err << ' ' << *sc->socket;
170 }
171 }
172 if (nleft) {
173 LOG(ERROR) << err.str();
174 }
175 }
176
177 delete _this_map_bvar;
178 _this_map_bvar = NULL;
179
180 delete _options.socket_creator;
181 _options.socket_creator = NULL;
182}
183
184int SocketMap::Init(const SocketMapOptions& options) {
185 if (_options.socket_creator != NULL) {

Callers

nothing calls this directly

Calls 6

bthread_stopFunction · 0.85
bthread_joinFunction · 0.85
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
FailedMethod · 0.45

Tested by

no test coverage detected