MCPcopy Create free account
hub / github.com/Kitware/CMake / Socket

Method Socket

Utilities/cmcppdap/src/socket.cpp:233–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231namespace dap {
232
233Socket::Socket(const char* address, const char* port)
234 : shared(Shared::create(address, port)) {
235 if (shared) {
236 shared->lock([&](SOCKET socket, const addrinfo* info) {
237 if (bind(socket, info->ai_addr, (int)info->ai_addrlen) != 0) {
238 shared.reset();
239 return;
240 }
241
242 if (listen(socket, 0) != 0) {
243 shared.reset();
244 return;
245 }
246 });
247 }
248}
249
250std::shared_ptr<ReaderWriter> Socket::accept() const {
251 std::shared_ptr<Shared> out;

Callers

nothing calls this directly

Calls 2

lockMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected