Commit 58a545b92cbef34cf1139f830f1dcdf9f362c038
1 parent
0d4cbfc4
停掉转发..
Showing
1 changed file
with
10 additions
and
10 deletions
src/main/java/com/bsth/client/ClientApp.java
| ... | ... | @@ -32,7 +32,7 @@ import java.util.concurrent.*; |
| 32 | 32 | public class ClientApp implements CommandLineRunner{ |
| 33 | 33 | |
| 34 | 34 | private static NioSocketConnector pdDataConnector; |
| 35 | - private static NioSocketConnector pfDataConnector; | |
| 35 | + //private static NioSocketConnector pfDataConnector; | |
| 36 | 36 | |
| 37 | 37 | @Autowired |
| 38 | 38 | private PdClientHandler pdClient; |
| ... | ... | @@ -91,7 +91,7 @@ public class ClientApp implements CommandLineRunner{ |
| 91 | 91 | }); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - public static void pfconnect(final String device) { | |
| 94 | +/* public static void pfconnect(final String device) { | |
| 95 | 95 | exec.submit(new Runnable() { |
| 96 | 96 | |
| 97 | 97 | @Override |
| ... | ... | @@ -105,15 +105,15 @@ public class ClientApp implements CommandLineRunner{ |
| 105 | 105 | System.out.println("重连, cost time: " + (System.currentTimeMillis() - now)); |
| 106 | 106 | } |
| 107 | 107 | }); |
| 108 | - } | |
| 108 | + }*/ | |
| 109 | 109 | |
| 110 | 110 | public static void pdreconn(){ |
| 111 | 111 | pdconnect(ConfigUtil.get("forward.device.name")); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - public static void pfreconn(){ | |
| 114 | + /*public static void pfreconn(){ | |
| 115 | 115 | pfconnect(ConfigUtil.get("forward.device.name")); |
| 116 | - } | |
| 116 | + }*/ | |
| 117 | 117 | |
| 118 | 118 | public void destroy(){ |
| 119 | 119 | try { |
| ... | ... | @@ -122,7 +122,7 @@ public class ClientApp implements CommandLineRunner{ |
| 122 | 122 | sexec.shutdownNow(); |
| 123 | 123 | |
| 124 | 124 | pdDataConnector.dispose(true); |
| 125 | - pfDataConnector.dispose(true); | |
| 125 | + //pfDataConnector.dispose(true); | |
| 126 | 126 | } catch (Exception e) { |
| 127 | 127 | logger.error("", e); |
| 128 | 128 | } |
| ... | ... | @@ -137,7 +137,7 @@ public class ClientApp implements CommandLineRunner{ |
| 137 | 137 | pfSession.closeNow(); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - public static boolean fconnect(String device) { | |
| 140 | +/* public static boolean fconnect(String device) { | |
| 141 | 141 | boolean flag = false; |
| 142 | 142 | try { |
| 143 | 143 | ConnectFuture con = pfDataConnector.connect(new InetSocketAddress(ConfigUtil.get("gps.server.pf"), Integer.parseInt(ConfigUtil.get("gps.port.pf")))); |
| ... | ... | @@ -152,7 +152,7 @@ public class ClientApp implements CommandLineRunner{ |
| 152 | 152 | e.printStackTrace(); |
| 153 | 153 | } |
| 154 | 154 | return flag; |
| 155 | - } | |
| 155 | + }*/ | |
| 156 | 156 | |
| 157 | 157 | public void init() { |
| 158 | 158 | logger.warn("socket client init..."); |
| ... | ... | @@ -231,10 +231,10 @@ public class ClientApp implements CommandLineRunner{ |
| 231 | 231 | ClientApp.pdreconn(); |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - if(!pfSession.isActive()){ | |
| 234 | + /*if(!pfSession.isActive()){ | |
| 235 | 235 | logger.warn("浦东转发设备注销"); |
| 236 | 236 | ClientApp.pfreconn(); |
| 237 | - } | |
| 237 | + }*/ | |
| 238 | 238 | } catch (Exception e) { |
| 239 | 239 | logger.error("SessionChecker异常", e); |
| 240 | 240 | } | ... | ... |