Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ import aws.sdk.kotlin.crt.Closeable
/**
* This class wraps aws-c-http to provide the basic HTTP request/response functionality via the AWS Common Runtime.
*
* HttpClientConnection represents a single connection to a HTTP service endpoint.
* HttpClientConnection represents a single connection to an HTTP service endpoint.
*
* This class is not thread safe and should not be called from different threads.
*/
public interface HttpClientConnection : Closeable {
/**
* The unique ID of this connection.
*/
public val id: String

/**
* Schedules an HttpRequest on the Native EventLoop for this HttpClientConnection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import software.amazon.awssdk.crt.http.HttpClientConnection as HttpClientConnect
* Wrapper around JNI HttpClientConnection type that implements the expected KMP interface
*/
internal class HttpClientConnectionJVM constructor(internal val jniConn: HttpClientConnectionJni) : HttpClientConnection {
override val id: String = jniConn.nativeHandle.toString()

override fun makeRequest(httpReq: HttpRequest, handler: HttpStreamResponseHandler): HttpStream {
val jniStream = jniConn.makeRequest(httpReq.into(), handler.asJniStreamResponseHandler())
Expand Down