MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / HandleReconnect

Method HandleReconnect

plugins/twitch/chat-connection.cpp:634–649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632}
633
634void TwitchChatConnection::HandleReconnect()
635{
636 blog(LOG_INFO,
637 "Received RECONNECT notice! Twitch chat connection will be terminated shortly!");
638
639 // We need a separate thread here as we cannot close the current
640 // connection from within the message handler
641 std::thread reconnectThread([token = this->_token,
642 channel = this->_channel]() {
643 auto chatConnection =
644 TwitchChatConnection::GetChatConnection(token, channel);
645 chatConnection->Disconnect();
646 chatConnection->Connect();
647 });
648 reconnectThread.detach();
649}
650
651void TwitchChatConnection::OnOpen(connection_hdl)
652{

Callers

nothing calls this directly

Calls 2

DisconnectMethod · 0.45
ConnectMethod · 0.45

Tested by

no test coverage detected