MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / initialize

Method initialize

src/server/lcdapi/api/LCDConnection.cpp:48–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void LCDConnection::initialize() {
49 memset(&_addr, 0, sizeof (_addr));
50
51 if (!isValid()) {
52 throw LCDException(LCD_SOCKET_CREATION_ERROR);
53 }
54
55 const int on = 1;
56 if (setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<const char*>(&on), sizeof (on)) == -1) {
57 throw LCDException(LCD_SOCKET_CREATION_ERROR);
58 }
59}
60
61bool LCDConnection::isValid() const {
62 return _sock != -1;

Callers

nothing calls this directly

Calls 1

LCDExceptionClass · 0.85

Tested by

no test coverage detected