Class HttpStreamBase
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
Http2Stream,HttpStream
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates the client stream.voidcancel()Cancels the stream with the default error code (AWS_ERROR_HTTP_STREAM_CANCELLED).intRetrieves the Http Response Status CodevoidincrementWindow(int windowSize) Increment the flow-control window, so that response data continues downloading.Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addRef, addReferenceTo, close, close, collectNativeResource, collectNativeResources, decRef, decRef, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
Method Details
-
incrementWindow
public void incrementWindow(int windowSize) Increment the flow-control window, so that response data continues downloading.If
HttpClientConnectionManagerOptions.withManualWindowManagement(boolean)was set true, each HTTP stream has a flow-control window that shrinks as response body data is downloaded (headers do not affect the size of the window).HttpClientConnectionManagerOptions.withWindowSize(long)sets the starting size for each HTTP stream's window. Whenever the window reaches zero, data stops downloading. Increment the window to keep data flowing. Maintain a larger window to keep up a high download throughput, parts cannot download in parallel unless the window is large enough to hold multiple parts. Maintain a smaller window to limit the amount of data buffered in memory.If manual window management is disabled this call has no effect.
- Parameters:
windowSize- How many bytes to increment the sliding window by.- See Also:
-
activate
public void activate()Activates the client stream. -
getResponseStatusCode
public int getResponseStatusCode()Retrieves the Http Response Status Code- Returns:
- The Http Response Status Code
-
cancel
public void cancel()Cancels the stream with the default error code (AWS_ERROR_HTTP_STREAM_CANCELLED).For HTTP/1.1 streams, this is equivalent to closing the connection. For HTTP/2 streams, this sends a RST_STREAM frame with AWS_HTTP2_ERR_CANCEL.
The stream will complete with AWS_ERROR_HTTP_STREAM_CANCELLED, unless the stream is already completing for other reasons, or the stream is not activated, in which case this call will have no effect.
-