MCPcopy Create free account
hub / github.com/dfranx/SHADERed / Socket

Method Socket

libs/cppdap/src/socket.cpp:222–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220namespace dap {
221
222Socket::Socket(const char* address, const char* port)
223 : shared(Shared::create(address, port)) {
224 if (shared) {
225 shared->lock([&](SOCKET socket, const addrinfo* info) {
226 if (bind(socket, info->ai_addr, (int)info->ai_addrlen) != 0) {
227 shared.reset();
228 return;
229 }
230
231 if (listen(socket, 0) != 0) {
232 shared.reset();
233 return;
234 }
235 });
236 }
237}
238
239std::shared_ptr<ReaderWriter> Socket::accept() const {
240 std::shared_ptr<Shared> out;

Callers

nothing calls this directly

Calls 3

lockMethod · 0.80
createFunction · 0.50
resetMethod · 0.45

Tested by

no test coverage detected