代码拉取完成,页面将自动刷新
当用TCP连接进行握手操作的时候,org.jim.server.command.handler.HandshakeReqHandler第36行因为wsSessionContext=null报错,导致不会执行后面的onAfterHandshake
package org.jim.server.command.handler;
import java.util.Objects;
import org.jim.core.ImChannelContext;
import org.jim.core.ImPacket;
import org.jim.core.exception.ImException;
import org.jim.core.http.HttpRequest;
import org.jim.core.packets.Command;
import org.jim.core.ws.WsSessionContext;
import org.jim.server.JimServerAPI;
import org.jim.server.command.AbstractCmdHandler;
import org.jim.server.processor.handshake.HandshakeCmdProcessor;
public class HandshakeReqHandler extends AbstractCmdHandler {
public HandshakeReqHandler() {
}
public ImPacket handler(ImPacket packet, ImChannelContext channelContext) throws ImException {
HandshakeCmdProcessor handshakeProcessor = (HandshakeCmdProcessor)this.getMultiProcessor(channelContext, HandshakeCmdProcessor.class);
if (Objects.isNull(handshakeProcessor)) {
JimServerAPI.remove(channelContext, "没有对应的握手协议处理器HandshakeCmdProcessor...");
return null;
} else {
ImPacket handShakePacket = handshakeProcessor.handshake(packet, channelContext);
if (handShakePacket == null) {
JimServerAPI.remove(channelContext, "业务层不同意握手");
return null;
} else {
JimServerAPI.send(channelContext, handShakePacket);
WsSessionContext wsSessionContext = (WsSessionContext)channelContext.getSessionContext();
HttpRequest request = wsSessionContext.getHandshakeRequestPacket();
handshakeProcessor.onAfterHandshake(request, channelContext);
return null;
}
}
}
public Command command() {
return Command.COMMAND_HANDSHAKE_REQ;
}
}
HttpRequest request = wsSessionContext.getHandshakeRequestPacket();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
get
登录 后才可以发表评论