| 632 | } |
| 633 | |
| 634 | void 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 | |
| 651 | void TwitchChatConnection::OnOpen(connection_hdl) |
| 652 | { |
nothing calls this directly
no test coverage detected