i2ptunnel: Retry accept after router soft restart (ticket #2003)

This sends the router restart indication from I2CP router side
to client side to streaming to I2PTunnelServer via
a new streaming exception.
This commit is contained in:
zzz
2018-02-18 13:53:50 +00:00
parent acebd2ea68
commit 826d8ca07f
10 changed files with 71 additions and 10 deletions

View File

@@ -30,7 +30,7 @@ class DisconnectMessageHandler extends HandlerImpl {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Handle message " + message);
String reason = ((DisconnectMessage)message).getReason();
session.propogateError(reason, new I2PSessionException("Disconnect Message received"));
session.propogateError(reason, new I2PSessionException("Disconnect Message received: " + reason));
session.destroySession(false);
if (reason.contains("restart")) {
Thread t = new I2PAppThread(new Reconnector(session), "Reconnect " + session, true);
@@ -47,7 +47,7 @@ class DisconnectMessageHandler extends HandlerImpl {
}
public void run() {
try { Thread.sleep(10*1000); } catch (InterruptedException ie) {}
try { Thread.sleep(40*1000); } catch (InterruptedException ie) {}
_session.reconnect();
}
}