|
@@ -25,7 +25,7 @@ public class EartagServer {
|
|
|
private EartagServerHandler2 serverHandler;
|
|
|
//监听端口
|
|
|
private int port = 10023;
|
|
|
- private int port2 = 10024;
|
|
|
+// private int port2 = 10024;
|
|
|
//创建构造方法
|
|
|
public EartagServer(){
|
|
|
}
|
|
@@ -67,10 +67,10 @@ public class EartagServer {
|
|
|
System.out.println("# 准备接收数据:");
|
|
|
//绑定端口,同步等待成功
|
|
|
ChannelFuture cf = serverBootstrap.bind(port).sync();
|
|
|
- ChannelFuture cf2 = serverBootstrap.bind(port2).sync();
|
|
|
+// ChannelFuture cf2 = serverBootstrap.bind(port2).sync();
|
|
|
// 等待服务端监听端口关闭
|
|
|
cf.channel().closeFuture().sync();
|
|
|
- cf2.channel().closeFuture().sync();
|
|
|
+// cf2.channel().closeFuture().sync();
|
|
|
}finally {
|
|
|
//优雅的退出
|
|
|
bossGroup.shutdownGracefully();
|
|
@@ -105,7 +105,7 @@ public class EartagServer {
|
|
|
// b.bind(port).sync();
|
|
|
// System.out.println("tcp server("+port+") is started..");
|
|
|
|
|
|
- b.bind(port2).sync();
|
|
|
- System.out.println("tcp server("+port2+") is started..");
|
|
|
+// b.bind(port2).sync();
|
|
|
+// System.out.println("tcp server("+port2+") is started..");
|
|
|
}
|
|
|
}
|