//ServerEndpoint是websocket的必备注解, value是映射路径, configurator是配置类.
@ServerEndpoint(value = "/websocket", configurator=NutWsConfigurator.class)
@IocBean // 使用NutWsConfigurator的必备条件
public class GameWebsocket extends AbstractWsEndpoint {
private static final Log log = Logs.get();
@Inject JedisAgent jedisAgent;
public WsHandler createHandler(Session session, EndpointConfig config) {
GameWsHandler gamehandler = new GameWsHandler("GameRoom:");
WsRoomProvider roomProvider = new JedisRoomProvider(jedisAgent);
gamehandler.setRoomProvider(roomProvider);
return gamehandler;
}
不知道是什么问题