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

Method Socket

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

Source from the content-addressed store, hash-verified

247namespace dap {
248
249Socket::Socket(const char* address, const char* port)
250 : shared(Shared::create(address, port)) {
251 if (shared) {
252 shared->lock([&](SOCKET socket, const addrinfo* info) {
253 if (bind(socket, info->ai_addr, (int)info->ai_addrlen) != 0) {
254 shared.reset();
255 return;
256 }
257
258 if (listen(socket, 0) != 0) {
259 shared.reset();
260 return;
261 }
262 });
263 }
264}
265
266std::shared_ptr<ReaderWriter> Socket::accept() const {
267 std::shared_ptr<Shared> out;

Callers

nothing calls this directly

Calls 3

createFunction · 0.85
lockMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected