public class HttpConnection extends CrtResource
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes and frees this HttpConnection and any native sub-resources associated with this connection
|
static CompletableFuture<HttpConnection> |
createConnection(URI uri,
ClientBootstrap bootstrap,
SocketOptions socketOptions,
TlsContext tlsContext)
Creates a new CompletableFuture for a new HttpConnection.
|
static CompletableFuture<HttpConnection> |
createConnection(URI uri,
ClientBootstrap bootstrap,
SocketOptions socketOptions,
TlsContext tlsContext,
int windowSize)
Creates a new CompletableFuture for a new HttpConnection.
|
CompletableFuture<Void> |
getShutdownFuture()
Returns the Shutdown Future
|
HttpStream |
makeRequest(HttpRequest request,
CrtHttpStreamHandler streamHandler)
Schedules an HttpRequest on the Native EventLoop for this HttpConnection.
|
CompletableFuture<Void> |
shutdown()
Schedules a task on the Native EventLoop to shut down the current connection
|
acquire, getAllocatedNativeResourceCount, getAllocatedNativeResources, isNull, native_ptr, own, release
public static CompletableFuture<HttpConnection> createConnection(URI uri, ClientBootstrap bootstrap, SocketOptions socketOptions, TlsContext tlsContext) throws CrtRuntimeException
uri
- Must be non-null and contain a hostnamebootstrap
- The ClientBootstrap to use for the ConnectionsocketOptions
- The SocketOptions to use for the ConnectiontlsContext
- The TlsContext to use for the ConnectionCrtRuntimeException
- if Native threw a CrtRuntimeExceptionpublic static CompletableFuture<HttpConnection> createConnection(URI uri, ClientBootstrap bootstrap, SocketOptions socketOptions, TlsContext tlsContext, int windowSize) throws CrtRuntimeException
uri
- Must be non-null and contain a hostnamebootstrap
- The ClientBootstrap to use for the ConnectionsocketOptions
- The SocketOptions to use for the ConnectiontlsContext
- The TlsContext to use for the ConnectionwindowSize
- The Initial Window size for requests made on this connectionCrtRuntimeException
- if Native threw a CrtRuntimeExceptionpublic HttpStream makeRequest(HttpRequest request, CrtHttpStreamHandler streamHandler) throws CrtRuntimeException
request
- The Request to make to the Server.streamHandler
- The Stream Handler to be called from the Native EventLoopCrtRuntimeException
public void close()
close
in interface AutoCloseable
close
in class CrtResource
public CompletableFuture<Void> getShutdownFuture()
public CompletableFuture<Void> shutdown()
Copyright © 2019. All rights reserved.