mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
reconnect to proxy if receive error
This commit is contained in:
parent
7f98a8b972
commit
c88638afe4
@ -277,10 +277,20 @@ namespace transport
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
{
|
||||
LogPrint (eLogError, "SSU2: Receive error: code ", ecode.value(), ": ", ecode.message ());
|
||||
auto ep = socket.local_endpoint ();
|
||||
socket.close ();
|
||||
OpenSocket (ep);
|
||||
Receive (socket);
|
||||
if (m_IsThroughProxy)
|
||||
{
|
||||
m_UDPAssociateSocket.reset (nullptr);
|
||||
m_ProxyRelayEndpoint.reset (nullptr);
|
||||
m_SocketV4.close ();
|
||||
ConnectToProxy ();
|
||||
}
|
||||
else
|
||||
{
|
||||
auto ep = socket.local_endpoint ();
|
||||
socket.close ();
|
||||
OpenSocket (ep);
|
||||
Receive (socket);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user