MCPcopy Create free account
hub / github.com/LUX-Core/lux / disconnected_cb

Method disconnected_cb

src/luxcontrol.cpp:673–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671}
672
673void LuxController::disconnected_cb(LuxControlConnection& _conn)
674{
675 // Stop advertising service when disconnected
676 if (service.IsValid())
677 RemoveLocal(service);
678 service = CService();
679 if (!reconnect)
680 return;
681
682 LogPrint("lux", "lux: Not connected to Lux control port %s, trying to reconnect\n", target);
683
684 // Single-shot timer for reconnect. Use exponential backoff.
685 struct timeval time = MillisToTimeval(int64_t(reconnect_timeout * 1000.0));
686 if (reconnect_ev)
687 event_add(reconnect_ev, &time);
688 reconnect_timeout *= RECONNECT_TIMEOUT_EXP;
689}
690
691void LuxController::Reconnect()
692{

Callers

nothing calls this directly

Calls 5

RemoveLocalFunction · 0.85
LogPrintFunction · 0.85
MillisToTimevalFunction · 0.85
CServiceClass · 0.70
IsValidMethod · 0.45

Tested by

no test coverage detected