MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / get_from_pool

Method get_from_pool

net/pooled_socket.cpp:139–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137 }
138
139 ISocketStream* get_from_pool(const EndPoint& ep) {
140 auto it = fdmap.find(ep);
141 if (it == fdmap.end()) return nullptr;
142 assert(it != fdmap.end());
143 auto node = it->second.pop_front();
144 rm_watch(node);
145 DEFER(delete node);
146 if (it->second.empty()) fdmap.erase(it);
147 return node->stream.release();
148 }
149
150 void push_into_pool(StreamListNode* node) {
151 fdmap[node->key].push_back(node);

Callers

nothing calls this directly

Calls 6

findMethod · 0.45
endMethod · 0.45
pop_frontMethod · 0.45
emptyMethod · 0.45
eraseMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected