MCPcopy Create free account
hub / github.com/davisking/dlib / shutdown

Method shutdown

dlib/sockets/sockets_kernel_1.cpp:453–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451// ----------------------------------------------------------------------------------------
452
453 int connection::
454 shutdown (
455 )
456 {
457 sd_mutex.lock();
458 if (sd)
459 {
460 sd_mutex.unlock();
461 return sdr;
462 }
463 sd = true;
464 SOCKET stemp = connection_socket;
465 connection_socket = INVALID_SOCKET;
466 sdr = closesocket(stemp);
467
468 // convert SOCKET_ERROR error code into the OTHER_ERROR error code
469 if (sdr == SOCKET_ERROR)
470 sdr = OTHER_ERROR;
471
472 int temp = sdr;
473
474 sd_mutex.unlock();
475 return temp;
476 }
477
478// ----------------------------------------------------------------------------------------
479

Callers

nothing calls this directly

Calls 2

lockMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected