2727import io .vertx .core .internal .logging .Logger ;
2828import io .vertx .core .internal .logging .LoggerFactory ;
2929import io .vertx .core .internal .net .NetClientInternal ;
30+ import io .vertx .core .internal .net .TcpClientInternal ;
3031import io .vertx .core .internal .tls .SslContextManager ;
3132import io .vertx .core .internal .tls .SslContextProvider ;
3233import io .vertx .core .net .*;
4849 * @author <a href="http://tfox.org">Tim Fox</a>
4950 * @author <a href="mailto:julien@julienviet.com">Julien Viet</a>
5051 */
51- class TcpClientImpl implements NetClientInternal {
52+ class TcpClientImpl implements TcpClientInternal {
5253
5354 private static final Logger log = LoggerFactory .getLogger (TcpClientImpl .class );
5455 protected final Duration idleTimeout ;
@@ -108,22 +109,22 @@ protected void initChannel(ChannelPipeline pipeline, boolean ssl) {
108109 }
109110
110111 @ Override
111- public Future <NetSocket > connect (int port , String host ) {
112+ public Future <TcpSocket > connect (int port , String host ) {
112113 return connect (port , host , (String ) null );
113114 }
114115
115116 @ Override
116- public Future <NetSocket > connect (int port , String host , String serverName ) {
117+ public Future <TcpSocket > connect (int port , String host , String serverName ) {
117118 return connect (SocketAddress .inetSocketAddress (port , host ), serverName );
118119 }
119120
120121 @ Override
121- public Future <NetSocket > connect (SocketAddress remoteAddress ) {
122+ public Future <TcpSocket > connect (SocketAddress remoteAddress ) {
122123 return connect (remoteAddress , null );
123124 }
124125
125126 @ Override
126- public Future <NetSocket > connect (SocketAddress remoteAddress , String serverName ) {
127+ public Future <TcpSocket > connect (SocketAddress remoteAddress , String serverName ) {
127128 ConnectOptions connectOptions = new ConnectOptions ();
128129 connectOptions .setRemoteAddress (remoteAddress );
129130 String peerHost = remoteAddress .host ();
@@ -141,15 +142,15 @@ public Future<NetSocket> connect(SocketAddress remoteAddress, String serverName)
141142 }
142143
143144 @ Override
144- public Future <NetSocket > connect (ConnectOptions connectOptions ) {
145+ public Future <TcpSocket > connect (ConnectOptions connectOptions ) {
145146 ContextInternal context = vertx .getOrCreateContext ();
146- Promise <NetSocket > promise = context .promise ();
147+ Promise <TcpSocket > promise = context .promise ();
147148 connectInternal (connectOptions , registerWriteHandler , promise , context , config .getReconnectAttempts ());
148149 return promise .future ();
149150 }
150151
151152 @ Override
152- public void connectInternal (ConnectOptions connectOptions , Promise <NetSocket > connectHandler , ContextInternal context ) {
153+ public void connectInternal (ConnectOptions connectOptions , Promise <TcpSocket > connectHandler , ContextInternal context ) {
153154 ClientSSLOptions sslOptions = connectOptions .getSslOptions ();
154155 if (sslOptions == null ) {
155156 connectOptions .setSslOptions (this .sslOptions );
@@ -172,7 +173,6 @@ private void handleClose(Completable<Void> completion) {
172173 }
173174 }
174175
175- @ Override
176176 public void close (Completable <Void > completion ) {
177177 channelGroup .shutdown (0 , TimeUnit .SECONDS ).onComplete (completion );
178178 }
@@ -208,7 +208,7 @@ public Future<Boolean> updateSSLOptions(ClientSSLOptions options, boolean force)
208208
209209 private void connectInternal (ConnectOptions connectOptions ,
210210 boolean registerWriteHandlers ,
211- Promise <NetSocket > connectHandler ,
211+ Promise <TcpSocket > connectHandler ,
212212 ContextInternal context ,
213213 int remainingAttempts ) {
214214 if (channelGroup .isStarted ()) {
@@ -242,7 +242,7 @@ private void connectInternal2(ConnectOptions connectOptions,
242242 ClientSSLOptions sslOptions ,
243243 SslContextProvider sslContextProvider ,
244244 boolean registerWriteHandlers ,
245- Promise <NetSocket > connectHandler ,
245+ Promise <TcpSocket > connectHandler ,
246246 ContextInternal context ,
247247 int remainingAttempts ) {
248248 EventLoop eventLoop = context .nettyEventLoop ();
@@ -375,7 +375,7 @@ private static SocketAddress peerAddress(SocketAddress remoteAddress, ConnectOpt
375375 private void connected (ContextInternal context ,
376376 ClientSSLOptions sslOptions ,
377377 Channel ch ,
378- Promise <NetSocket > connectHandler ,
378+ Promise <TcpSocket > connectHandler ,
379379 SocketAddress remoteAddress ,
380380 boolean ssl ,
381381 boolean registerWriteHandlers ) {
@@ -400,7 +400,7 @@ private void connected(ContextInternal context,
400400 ch .pipeline ().addLast ("handler" , handler );
401401 }
402402
403- private void failed (ContextInternal context , Channel ch , Throwable th , Promise <NetSocket > connectHandler ) {
403+ private void failed (ContextInternal context , Channel ch , Throwable th , Promise <TcpSocket > connectHandler ) {
404404 if (ch != null ) {
405405 ch .close ();
406406 }
0 commit comments