if (serverResponse.contains("PING ")) {
writer.write("PONG " + serverResponse.substring(5) + "\r\n");
writer.write("PRIVMSG " + c.getHomechannel() + " :I got pinged!\r\n");
System.out.println("pinged");
writer.flush( );
}
和
if (cmd.equalsIgnoreCase("PING")) {
TCPRequestManager.sendWrite("PONG " + param);
TCPRequestManager.doMsg("c.getHomechannel()", ":I got pinged!");
TCPConnectionManager.getWriter().flush( );
}
两者似乎都在工作并向我发送消息说客户已被 ping,但我认为由于断开连接,它实际上并没有返回乒乓球,我做错了什么吗?