Commit 58a545b92cbef34cf1139f830f1dcdf9f362c038

Authored by 潘钊
1 parent 0d4cbfc4

停掉转发..

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