MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / accept

Method accept

3rdparty/cppdap/src/socket.cpp:266–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266std::shared_ptr<ReaderWriter> Socket::accept() const {
267 std::shared_ptr<Shared> out;
268 if (shared) {
269 shared->lock([&](SOCKET socket, const addrinfo*) {
270 if (socket != InvalidSocket && !errored(socket)) {
271 init();
272 auto accepted = ::accept(socket, 0, 0);
273 if (accepted != InvalidSocket) {
274 out = std::make_shared<Shared>(accepted);
275 out->setOptions();
276 }
277 }
278 });
279 }
280 return out;
281}
282
283bool Socket::isOpen() const {
284 if (shared) {

Callers 2

TESTFunction · 0.45
startMethod · 0.45

Calls 4

erroredFunction · 0.85
initFunction · 0.85
lockMethod · 0.45
setOptionsMethod · 0.45

Tested by 1

TESTFunction · 0.36