String uri = RequestUtils.getServletPath(request);
throw new DispatchException("Cant find comet handler by [" + uri
+ "]. Did you registered it?");
}
PushSocket socket = new PushSocket();
boolean accept = service.accept(socket, request);
PrintWriter write = response.getWriter();
String commend = null;
if (accept) {// 如果接受连接请求则创建连接
socketManager.creatConnection(socket);
commend = JsonProtocolUtils.getConnectionCommend(socket.getId());
} else {// 如果拒绝连接请求
commend = JsonProtocolUtils.getConnectionCommend(null);
}
// 返回生成的链接id
write.write(commend);