< prev index next >

src/java.net.http/share/classes/jdk/internal/net/http/HttpConnection.java

Print this page

        

@@ -106,13 +106,19 @@
 
     final HttpClientImpl client() {
         return client;
     }
 
-    //public abstract void connect() throws IOException, InterruptedException;
+    /**
+     * Initiates the connect and returns a CompletableFuture that completes
+     * when the initial connection phase has been established or an error
+     * occurs. The given exchange provides access connect timeout configuration.
+     */
+    public abstract CompletableFuture<Void> connectAsync(Exchange<?> exchange);
 
-    public abstract CompletableFuture<Void> connectAsync();
+    /** Completes the connection phase. Must be called after connectAsync. */
+    public abstract CompletableFuture<Void> finishConnect();
 
     /** Tells whether, or not, this connection is connected to its destination. */
     abstract boolean connected();
 
     /** Tells whether, or not, this connection is secure ( over SSL ) */
< prev index next >