我写了个消息转发程序,也加了心跳处理,1分钟没读写操作的用户自动被踢下线。可是现在遇到一个问题,如A用户要发送消息给B用户,通过服务器中转,服务器在接收到A的消息时,B用户实际已经断网了(我把B用户的网线拔掉了),这时服务器既然是不知道的。
ChannelFuture writeFuture = channel.write(msg);
			
final Channel sendChannel = ctx.channel();
			
writeFuture.addListener(new ChannelFutureListener() {
				
   @Override
   public void operationComplete(ChannelFuture future) throws Exception {
				
	if (future.isSuccess()){
	     sendChannel.write(JSONResult.getSuccess());
	     System.err.println("future.isSuccess()");
	}
	if (future.isDone()){
	     sendChannel.write(JSONResult.getSuccess());
	     System.err.println("future.isDone()");
	}
	if (future.isCancelled()){
	     sendChannel.write(JSONResult.getSuccess());
	     System.err.println("future.isCancelled()");
	}
					
    }
 });
operationComplete都会返回成功..只有到了1分钟的时候,服务器才回把B用户踢下线.我要怎么才能在服务端判断B用户实际已经掉线了?