use of com.akaxin.site.connector.netty.NettyServer in project openzaly by akaxincom.
the class Bootstrap method startNettyServer.
/**
* 启动Netty服务器,提供用户与站点服务之间的长链接功能
*
* @param address
* @param port
* @throws Exception
*/
private static void startNettyServer(String address, int port) throws Exception {
new NettyServer() {
@Override
public void loadExecutor(AbstracteExecutor<Command, CommandResponse> executor) {
executor.addChain(RequestAction.IM_SITE.getName(), new ImSiteAuthHandler());
executor.addChain(RequestAction.IM.getName(), new ImMessageHandler());
executor.addChain(RequestAction.API.getName(), new ApiRequestHandler());
}
}.start(address, port);
logger.info("{} start netty server {}:{} ok.", AkxProject.PLN, address, port);
}
Aggregations