Restart IpcClient after OS suspend
This commit is contained in:
parent
517930dd22
commit
e730521576
4 changed files with 12 additions and 5 deletions
|
|
@ -18,6 +18,12 @@ bool IpcClient::isSocketConnected() const
|
||||||
return m_isSocketConnected;
|
return m_isSocketConnected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IpcClient::close()
|
||||||
|
{
|
||||||
|
if (m_localSocket)
|
||||||
|
m_localSocket->close();
|
||||||
|
}
|
||||||
|
|
||||||
IpcClient *IpcClient::Instance()
|
IpcClient *IpcClient::Instance()
|
||||||
{
|
{
|
||||||
return m_instance;
|
return m_instance;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ public:
|
||||||
static QSharedPointer<PrivilegedProcess> CreatePrivilegedProcess();
|
static QSharedPointer<PrivilegedProcess> CreatePrivilegedProcess();
|
||||||
|
|
||||||
bool isSocketConnected() const;
|
bool isSocketConnected() const;
|
||||||
|
void close();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -161,9 +161,6 @@ void WindowsPingSender::sendPing(const QHostAddress& dest, quint16 sequence) {
|
||||||
DWORD status = GetLastError();
|
DWORD status = GetLastError();
|
||||||
if (status != ERROR_IO_PENDING) {
|
if (status != ERROR_IO_PENDING) {
|
||||||
QString errmsg = WindowsUtils::getErrorMessage();
|
QString errmsg = WindowsUtils::getErrorMessage();
|
||||||
if (status == ERROR_INVALID_NETNAME) {
|
|
||||||
emit criticalPingError();
|
|
||||||
}
|
|
||||||
logger.error() << "failed to start Code: " << status
|
logger.error() << "failed to start Code: " << status
|
||||||
<< " Message: " << errmsg
|
<< " Message: " << errmsg
|
||||||
<< " dest:" << logger.sensitive(dest.toString());
|
<< " dest:" << logger.sensitive(dest.toString());
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,6 @@ void VpnConnection::onConnectionStateChanged(Vpn::ConnectionState state)
|
||||||
|
|
||||||
} else if (state == Vpn::ConnectionState::Error) {
|
} else if (state == Vpn::ConnectionState::Error) {
|
||||||
IpcClient::Interface()->flushDns();
|
IpcClient::Interface()->flushDns();
|
||||||
auto result = IpcClient::Interface()->stopNetworkCheck();
|
|
||||||
result.waitForFinished(3000);
|
|
||||||
|
|
||||||
if (m_settings->isSitesSplitTunnelingEnabled()) {
|
if (m_settings->isSitesSplitTunnelingEnabled()) {
|
||||||
if (m_settings->routeMode() == Settings::VpnOnlyForwardSites) {
|
if (m_settings->routeMode() == Settings::VpnOnlyForwardSites) {
|
||||||
|
|
@ -224,6 +222,11 @@ void VpnConnection::connectToVpn(int serverIndex, const ServerCredentials &crede
|
||||||
.arg(serverIndex)
|
.arg(serverIndex)
|
||||||
.arg(ContainerProps::containerToString(container));
|
.arg(ContainerProps::containerToString(container));
|
||||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||||
|
if (m_IpcClient) {
|
||||||
|
m_IpcClient->close();
|
||||||
|
m_IpcClient = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_IpcClient) {
|
if (!m_IpcClient) {
|
||||||
m_IpcClient = new IpcClient(this);
|
m_IpcClient = new IpcClient(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue