Pārlūkot izejas kodu

修改到docker外运行环境

tags/v1.0.0^2
林万龙 pirms 3 gadiem
vecāks
revīzija
01a7c500a3
1 mainītis faili ar 15 papildinājumiem un 9 dzēšanām
  1. +15
    -9
      src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java

+ 15
- 9
src/main/java/com/telpo/dipperposition/handler/NettyServerHandler.java Parādīt failu

@@ -27,9 +27,12 @@ import java.time.LocalDateTime;
@Slf4j
public class NettyServerHandler extends ChannelInboundHandlerAdapter {

private static String AST_TIME_CMD = "54494d45";
private static String AST_POS_CMD = "504f53";
private static String AST_EPH_CMD = "455048";
private static String AST_TIME_CMD = "TIME";
private static String AST_POS_CMD = "POS";
private static String AST_EPH_CMD = "EPH";
private static String AST_TIME_CMD_BYTE = "54494d45";
private static String AST_POS_CMD_BYTE = "504f53";
private static String AST_EPH_CMD_BYTE = "455048";

@Autowired
private IDipperAstTimeAsyncTaskService dipperTimeAsyncTaskService;
@@ -96,15 +99,16 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
SocketChannel channel = (SocketChannel) ctx.channel();
String ipAddress = channel.remoteAddress().toString();
//String message = " 接收到消息:{0}, 客户端IP:{1}";
log.info("接收到消息:" + msg + "客户端IP:" + ipAddress);
log.info("接收到消息:" + msg + ",客户端IP:" + ipAddress);

String channelAns = "";
// 返回时间指令
//if (Integer.parseInt(timeAsycServerPort) == channel.localAddress().getPort()) {
ByteBuf recvmg = (ByteBuf) msg;
//ByteBuf recvmg = (ByteBuf) msg;
ByteBuf buf = null;
String recvmgStr = recvmg.toString();
if (AST_TIME_CMD.equals(recvmg)) {
//String recvmgStr = recvmg.toString();
//if (AST_TIME_CMD.equals(recvmg)) {
if (AST_TIME_CMD.equals(msg)) {
// 初始时间辅助输入;
channelAns = dipperTimeAsyncTaskService.pushAstTime();
}
@@ -112,7 +116,8 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
// 发送SDBP-AST-POS获取辅助位置信息
// if (Integer.parseInt(posAsycServerPort) == channel.localAddress().getPort()) {

if (AST_POS_CMD.equals(recvmg)) {
//if (AST_POS_CMD.equals(recvmg)) {
if (AST_TIME_CMD.equals(msg)) {
// channelAns = dipperAstPosAsyncTaskService.pushAstPos(ipAddress,
// positionConfig.getCenterProvinceFilePath(),
// positionConfig.getCenterProvince(),
@@ -127,7 +132,8 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {

// 从缓存获取SDBP-AST-EPH星历数
//if (Integer.parseInt(starsAsycServerPort) == channel.localAddress().getPort()) {
if (AST_POS_CMD.equals(recvmg)) {
//if (AST_POS_CMD.equals(recvmg)) {
if (AST_POS_CMD.equals(msg)) {
channelAns = dipperDataAsyncTaskService.getAstEPH();
}



Notiek ielāde…
Atcelt
Saglabāt