mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-15 23:38:32 +08:00
update
This commit is contained in:
@@ -104,19 +104,16 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
|||||||
log.info("[" + channel.remoteAddress() + "] 主动发送push请求信息:{}", wholeMsg);
|
log.info("[" + channel.remoteAddress() + "] 主动发送push请求信息:{}", wholeMsg);
|
||||||
ByteBuf byteBuf = channel.alloc().buffer().writeBytes(writeMsg);
|
ByteBuf byteBuf = channel.alloc().buffer().writeBytes(writeMsg);
|
||||||
ChannelFuture channelFuture = channel.writeAndFlush(byteBuf);
|
ChannelFuture channelFuture = channel.writeAndFlush(byteBuf);
|
||||||
channelFuture.addListener(new ChannelFutureListener() {
|
channelFuture.addListener((ChannelFutureListener) channelFutureListener -> {
|
||||||
@Override
|
// 检查操作的状态
|
||||||
public void operationComplete(ChannelFuture channelFuture) throws Exception {
|
if (channelFutureListener.isSuccess()) {
|
||||||
// 检查操作的状态
|
log.info("push结果【成功】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}, ", channel.remoteAddress(), channel.id(), value, wholeMsg);
|
||||||
if (channelFuture.isSuccess()) {
|
} else {
|
||||||
log.info("push结果【成功】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}, ", channel.remoteAddress(), channel.id(), value, wholeMsg);
|
// 如果发生错误,则访问描述原因的Throwable
|
||||||
} else {
|
Throwable cause = channelFutureListener.cause();
|
||||||
// 如果发生错误,则访问描述原因的Throwable
|
// cause.printStackTrace();
|
||||||
Throwable cause = channelFuture.cause();
|
log.info("push结果【失败】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}", channel.remoteAddress(), channel.id(), value, wholeMsg);
|
||||||
// cause.printStackTrace();
|
log.error("push发送命令失败", cause);
|
||||||
log.info("push结果【失败】, remoteAddress:{}, channelId:{}, 帧类型:{}, 报文:{}", channel.remoteAddress(), channel.id(), value, wholeMsg);
|
|
||||||
log.error("push发送命令失败", cause);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user