AWS IoT Device SDK C++ v2 1.44.1
AWS IoT Device SDK C++ v2
Loading...
Searching...
No Matches
Aws::Crt::Http::HttpClientConnection Class Reference

#include <HttpConnection.h>

Inheritance diagram for Aws::Crt::Http::HttpClientConnection:
Aws::Crt::Http::ManagedConnection Aws::Crt::Http::UnmanagedConnection

Public Member Functions

virtual ~HttpClientConnection ()=default
 HttpClientConnection (const HttpClientConnection &)=delete
 HttpClientConnection (HttpClientConnection &&)=delete
HttpClientConnectionoperator= (const HttpClientConnection &)=delete
HttpClientConnectionoperator= (HttpClientConnection &&)=delete
std::shared_ptr< HttpClientStreamNewClientStream (const HttpRequestOptions &requestOptions) noexcept
bool IsOpen () const noexcept
void Close () noexcept
HttpVersion GetVersion () noexcept
int LastError () const noexcept

Static Public Member Functions

static bool CreateConnection (const HttpClientConnectionOptions &connectionOptions, Allocator *allocator) noexcept

Protected Member Functions

 HttpClientConnection (aws_http_connection *m_connection, Allocator *allocator) noexcept

Protected Attributes

aws_http_connection * m_connection

Detailed Description

Represents a connection from a Http Client to a Server.

Constructor & Destructor Documentation

◆ ~HttpClientConnection()

virtual Aws::Crt::Http::HttpClientConnection::~HttpClientConnection ( )
virtualdefault

◆ HttpClientConnection() [1/3]

Aws::Crt::Http::HttpClientConnection::HttpClientConnection ( const HttpClientConnection & )
delete

◆ HttpClientConnection() [2/3]

Aws::Crt::Http::HttpClientConnection::HttpClientConnection ( HttpClientConnection && )
delete

◆ HttpClientConnection() [3/3]

Aws::Crt::Http::HttpClientConnection::HttpClientConnection ( aws_http_connection * m_connection,
Allocator * allocator )
protectednoexcept

Member Function Documentation

◆ Close()

void Aws::Crt::Http::HttpClientConnection::Close ( )
noexcept

Initiate a shutdown of the connection. Sometimes, connections are persistent and you want to close them before shutting down your application or whatever is consuming this interface.

Assuming OnConnectionShutdown has not already been invoked, it will be invoked as a result of this call.

◆ CreateConnection()

bool Aws::Crt::Http::HttpClientConnection::CreateConnection ( const HttpClientConnectionOptions & connectionOptions,
Allocator * allocator )
staticnoexcept

Create a new Https Connection to hostName:port, using socketOptions for tcp options and tlsConnOptions for TLS/SSL options. If tlsConnOptions is null http (plain-text) will be used.

returns true on success, and false on failure. If false is returned, onConnectionSetup will not be invoked. On success, onConnectionSetup will be called, either with a connection, or an errorCode.

◆ GetVersion()

HttpVersion Aws::Crt::Http::HttpClientConnection::GetVersion ( )
noexcept
Returns
protocol version the connection used

◆ IsOpen()

bool Aws::Crt::Http::HttpClientConnection::IsOpen ( ) const
noexcept
Returns
true unless the connection is closed or closing.

◆ LastError()

int Aws::Crt::Http::HttpClientConnection::LastError ( ) const
inlinenoexcept
Returns
the value of the last aws error encountered by operations on this instance.

◆ NewClientStream()

std::shared_ptr< HttpClientStream > Aws::Crt::Http::HttpClientConnection::NewClientStream ( const HttpRequestOptions & requestOptions)
noexcept

Make a new client initiated request on this connection.

If you take a reference to the return value, the memory and resources for the connection and stream will not be cleaned up until you release it. You can however, release the reference as soon as you don't need it anymore. The internal reference count ensures the resources will not be freed until the stream is completed.

Returns an instance of HttpStream upon success and nullptr on failure.

You must call HttpClientStream::Activate() to begin outgoing processing of the stream.

◆ operator=() [1/2]

HttpClientConnection & Aws::Crt::Http::HttpClientConnection::operator= ( const HttpClientConnection & )
delete

◆ operator=() [2/2]

HttpClientConnection & Aws::Crt::Http::HttpClientConnection::operator= ( HttpClientConnection && )
delete

Member Data Documentation

◆ m_connection

aws_http_connection* Aws::Crt::Http::HttpClientConnection::m_connection
protected

The documentation for this class was generated from the following files: