|
|
|
package com.crossoverjie.netty.action.server;
|
|
|
|
package com.crossoverjie.cim.server.server;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.crossoverjie.netty.action.common.pojo.CustomProtocol;
|
|
|
|
import com.crossoverjie.netty.action.common.protocol.BaseRequestProto;
|
|
|
|
import com.crossoverjie.netty.action.init.HeartbeatInitializer;
|
|
|
|
import com.crossoverjie.netty.action.util.NettySocketHolder;
|
|
|
|
import com.crossoverjie.netty.action.vo.req.SendMsgReqVO;
|
|
|
|
import com.crossoverjie.cim.common.protocol.BaseRequestProto;
|
|
|
|
import com.crossoverjie.cim.server.util.NettySocketHolder;
|
|
|
|
import com.crossoverjie.cim.server.vo.req.SendMsgReqVO;
|
|
|
|
import com.crossoverjie.cim.common.pojo.CustomProtocol;
|
|
|
|
import com.crossoverjie.cim.server.init.HeartbeatInitializer;
|
|
|
|
import io.netty.bootstrap.ServerBootstrap;
|
|
|
|
import io.netty.buffer.Unpooled;
|
|
|
|
import io.netty.channel.ChannelFuture;
|
|
...
|
...
|
@@ -46,7 +46,7 @@ public class HeartBeatServer { |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 启动 Netty
|
|
|
|
* 启动 cim server
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @throws InterruptedException
|
|
...
|
...
|
@@ -64,7 +64,7 @@ public class HeartBeatServer { |
|
|
|
|
|
|
|
ChannelFuture future = bootstrap.bind().sync();
|
|
|
|
if (future.isSuccess()) {
|
|
|
|
LOGGER.info("启动 Netty 成功");
|
|
|
|
LOGGER.info("启动 cim server 成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -76,7 +76,7 @@ public class HeartBeatServer { |
|
|
|
public void destroy() {
|
|
|
|
boss.shutdownGracefully().syncUninterruptibly();
|
|
|
|
work.shutdownGracefully().syncUninterruptibly();
|
|
|
|
LOGGER.info("关闭 Netty 成功");
|
|
|
|
LOGGER.info("关闭 cim server 成功");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
...
|
...
|
|