|
|
@@ -60,8 +60,7 @@ public class NioSocketHandler extends SimpleChannelInboundHandler<String>{ |
|
|
|
|
|
|
|
|
|
|
|
//编号2代表需要等待时长,编号3代表当前排队人数,编号4代表当前场内出租车,编号5代表在途出租车 |
|
|
|
//private static final int[] types = new int[] {2,3,4,5}; |
|
|
|
private static final int[] types = new int[] {3}; |
|
|
|
private static final int[] types = new int[] {2,3,4,5}; |
|
|
|
|
|
|
|
private void handleMessage(ChannelHandlerContext ctx,String message) { |
|
|
|
if (StringUtils.isBlank(message)) { |
|
|
@@ -102,6 +101,11 @@ public class NioSocketHandler extends SimpleChannelInboundHandler<String>{ |
|
|
|
dxobj.put("data", datas1); |
|
|
|
String dengxiangcontent = JSON.toJSONString(dxobj); |
|
|
|
log.debug("haikang send result:"+dengxiangcontent); |
|
|
|
try { |
|
|
|
Thread.sleep(3000); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
log.error("netty handleMessage error.",e); |
|
|
|
} |
|
|
|
ctx.writeAndFlush(dengxiangcontent); |
|
|
|
} |
|
|
|
} |
|
|
|