text: (window.webpackJsonp=window.webpackJsonp||[]).push([[262],{633:function(t,s,a){"use strict";a.r(s);var e=a(42),o=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"communicationutils-hpp"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#communicationutils-hpp"}},[t._v("#")]),t._v(" CommunicationUtils.hpp"),a("seo")],1),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/oatpp/oatpp/blob/master/src/oatpp/web/protocol/http/utils/CommunicationUtils.hpp",target:"_blank",rel:"noopener noreferrer"}},[t._v("This File On Github"),a("OutboundLink")],1),a("br"),t._v(" "),a("a",{attrs:{href:"https://github.com/oatpp/oatpp/issues/new?title=API%20question&body=In%20file:%20oatpp/web/protocol/http/utils/CommunicationUtils.hpp%0A%0A%23%20Question%0A%0A%3Cyour-question-here%3E",target:"_blank",rel:"noopener noreferrer"}},[t._v("Ask A Question"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("code",[t._v("API: latest")]),a("br"),t._v(" "),a("code",[t._v("module: oatpp")]),a("br"),t._v(" "),a("code",[t._v('#include "oatpp/web/protocol/http/utils/CommunicationUtils.hpp"')])]),t._v(" "),a("h2",{attrs:{id:"communicationutils"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#communicationutils"}},[t._v("#")]),t._v(" CommunicationUtils")]),t._v(" "),a("p",[t._v("Helper class for communication utils.")]),t._v(" "),a("div",{staticClass:"language-cpp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-cpp"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" oatpp "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" web "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" protocol "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" http "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" utils "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n  "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("CommunicationUtils")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Return Type")]),t._v(" "),a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Summary")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("void")])]),t._v(" "),a("td",[a("a",{attrs:{href:"#communicationutils-considerconnectionstate"}},[t._v("considerConnectionState")])]),t._v(" "),a("td",[t._v("Consider keep connection alive taking into account request headers, response headers and protocol version."),a("br")])])])]),t._v(" "),a("h3",{attrs:{id:"communicationutils-considerconnectionstate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#communicationutils-considerconnectionstate"}},[t._v("#")]),t._v(" CommunicationUtils::considerConnectionState")]),t._v(" "),a("p",[t._v("Consider keep connection alive taking into account request headers, response headers and protocol version."),a("br"),t._v(" Corresponding header will be set to response if not existed before. "),a("br"),t._v(" "),a("ul",[a("li",[a("strong",[t._v("@param")]),t._v(" request - "),a("code",[t._v("std::shared_ptr")]),t._v(" to "),a("RouterLink",{attrs:{to:"/api/latest/oatpp/web/protocol/http/incoming/Request/#request"}},[t._v("oatpp::web::protocol::http::incoming::Request")])],1),a("li",[a("strong",[t._v("@param")]),t._v(" response - "),a("code",[t._v("std::shared_ptr")]),t._v(" to "),a("RouterLink",{attrs:{to:"/api/latest/oatpp/web/protocol/http/outgoing/Response/#response"}},[t._v("oatpp::web::protocol::http::outgoing::Response")])],1),a("li",[a("strong",[t._v("@param")]),t._v(" connectionState ")])])]),t._v(" "),a("div",{staticClass:"language-cpp extra-class"},[a("pre",{pre:!0,attrs:{class:"language-cpp"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("considerConnectionState")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("protocol"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("http"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("incoming"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("Request"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" request"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                                    "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("protocol"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("http"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("outgoing"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("Response"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" response"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n                                    ConnectionState"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" connectionState"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=o.exports}}]);