CommunicationUtils.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/web/protocol/http/outgoing/CommunicationUtils.hpp"

CommunicationUtils

Helper class for communication utils.

namespace oatpp { namespace web { namespace protocol { namespace http { namespace outgoing { 
  class CommunicationUtils {}
}}}}}

Fields

Type Name Summary
v_int32 CONNECTION_STATE_CLOSE Connection state - close.
v_int32 CONNECTION_STATE_KEEP_ALIVE Connection state - keep alive.
v_int32 CONNECTION_STATE_UPGRADE Connection state - upgrade.

Methods

Return Type Name Summary
v_int32 considerConnectionState Consider keep connection alive taking into account request headers, response headers and protocol version.

CommunicationUtils::CONNECTION_STATE_CLOSE

Connection state - close.

static constexpr v_int32 CONNECTION_STATE_CLOSE = 0

CommunicationUtils::CONNECTION_STATE_KEEP_ALIVE

Connection state - keep alive.

static constexpr v_int32 CONNECTION_STATE_KEEP_ALIVE = 1

CommunicationUtils::CONNECTION_STATE_UPGRADE

Connection state - upgrade.

static constexpr v_int32 CONNECTION_STATE_UPGRADE = 2

CommunicationUtils::considerConnectionState

Consider keep connection alive taking into account request headers, response headers and protocol version.
Corresponding header will be set to response if not existed before.
return one of (CONNECTION_STATE_CLOSE, CONNECTION_STATE_KEEP_ALIVE, CONNECTION_STATE_UPGRADE).

static v_int32 considerConnectionState(const std::shared_ptr<protocol::http::incoming::Request>& request,
                                       const std::shared_ptr<protocol::http::outgoing::Response>& response)