|
|
|
|
@ -32,10 +32,6 @@ public class PuTianNettyClient {
|
|
|
|
|
@Resource
|
|
|
|
|
private EmptyCheckService emptyCheckService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 重连最大次数
|
|
|
|
|
*/
|
|
|
|
|
private static int RECONNECT_NUM = 10;
|
|
|
|
|
|
|
|
|
|
private static Channel channel;
|
|
|
|
|
|
|
|
|
|
@ -71,8 +67,13 @@ public class PuTianNettyClient {
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
// while (ksec.getReconnectNum() == -1 || num < ksec.getReconnectNum() && !isConnected) {
|
|
|
|
|
while (num < RECONNECT_NUM && !isConnected) {
|
|
|
|
|
while (ksec.getReconnectNum() == -1 || num < ksec.getReconnectNum() && !isConnected) {
|
|
|
|
|
//while (num < RECONNECT_NUM && !isConnected) {
|
|
|
|
|
try {
|
|
|
|
|
Thread.sleep(ksec.getReconnectInterval());
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
createClient(ksec);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|