|
|
|
|
@ -67,13 +67,18 @@ public class KsecNettyClient {
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
while (num < RECONNECT_NUM && !isConnected) {
|
|
|
|
|
while ((ksec.getReconnectNum() == -1 || num < ksec.getReconnectNum() ) && !isConnected) {
|
|
|
|
|
try {
|
|
|
|
|
createClient(ksec);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
//没连上 继续
|
|
|
|
|
log.error("reconnect error num:{}", num);
|
|
|
|
|
num++;
|
|
|
|
|
try {
|
|
|
|
|
Thread.sleep(ksec.getReconnectInterval()*1000);
|
|
|
|
|
} catch (InterruptedException ex) {
|
|
|
|
|
throw new RuntimeException(ex);
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
isConnected = true;
|
|
|
|
|
|