|
@@ -36,23 +36,7 @@ public class NettyTcpClientVds implements Callable<Object> {
|
|
|
if (this.clientBootstrap == null) {
|
|
if (this.clientBootstrap == null) {
|
|
|
this.clientBootstrap = this.bootstrapFactory.createBootstrap();
|
|
this.clientBootstrap = this.bootstrapFactory.createBootstrap();
|
|
|
}
|
|
}
|
|
|
-// if (this.connectListener == null) {
|
|
|
|
|
-// this.connectListener = new NettyTcpClientConnectListener(this);
|
|
|
|
|
-// }
|
|
|
|
|
-// if (this.closeListener == null) {
|
|
|
|
|
-// this.closeListener = new NettyTcpClientCloseListener(this);
|
|
|
|
|
-// }
|
|
|
|
|
-// this.channel = this.channelFuture
|
|
|
|
|
-// .addListener(this.connectListener)
|
|
|
|
|
-// .channel()
|
|
|
|
|
-// .closeFuture()
|
|
|
|
|
-// .addListener(this.closeListener)
|
|
|
|
|
-// .channel();
|
|
|
|
|
- connect();
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- public void connect() {
|
|
|
|
|
log.info("VDS Server try connect: {}, {}", this.ipAddress, this.port);
|
|
log.info("VDS Server try connect: {}, {}", this.ipAddress, this.port);
|
|
|
if (this.channelFuture != null && this.channelFuture.channel() != null) {
|
|
if (this.channelFuture != null && this.channelFuture.channel() != null) {
|
|
|
this.channelFuture.channel().close();
|
|
this.channelFuture.channel().close();
|
|
@@ -60,7 +44,7 @@ public class NettyTcpClientVds implements Callable<Object> {
|
|
|
}
|
|
}
|
|
|
this.channelFuture = this.clientBootstrap.connect(new InetSocketAddress(this.ipAddress, this.port));
|
|
this.channelFuture = this.clientBootstrap.connect(new InetSocketAddress(this.ipAddress, this.port));
|
|
|
this.channelFuture.addListener(new ChannelFutureListener() {
|
|
this.channelFuture.addListener(new ChannelFutureListener() {
|
|
|
- // 연결에 대한 리스터 추가
|
|
|
|
|
|
|
+ // 연결에 대한 리스너 추가
|
|
|
@Override
|
|
@Override
|
|
|
public void operationComplete(ChannelFuture future) {
|
|
public void operationComplete(ChannelFuture future) {
|
|
|
if (future.isSuccess()) {
|
|
if (future.isSuccess()) {
|
|
@@ -79,6 +63,7 @@ public class NettyTcpClientVds implements Callable<Object> {
|
|
|
channelClosed(future.channel());
|
|
channelClosed(future.channel());
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Channel getChannel() {
|
|
public Channel getChannel() {
|