EISCONN check if already connected in AsyncClient ConnectCoroutine

This commit is contained in:
lganzzzo 2018-04-18 22:58:51 +03:00
parent e34e9c1f6e
commit 4f9a13e26d
2 changed files with 4 additions and 2 deletions

View File

@ -128,7 +128,7 @@ oatpp::async::Action SimpleTCPConnectionProvider::getConnectionAsync(oatpp::asyn
Action doConnect() {
errno = 0;
auto res = connect(m_clientHandle, (struct sockaddr *)&m_client, sizeof(m_client));
if(res == 0) {
if(res == 0 || errno == EISCONN) {
return _return(oatpp::network::Connection::createShared(m_clientHandle));
}
if(errno == EALREADY || errno == EINPROGRESS) {

View File

@ -78,6 +78,8 @@ public:
typedef oatpp::data::mapping::type::Boolean::PtrWrapper Boolean;
public:
typedef oatpp::web::protocol::http::incoming::Response Response;
public:
typedef RequestExecutor::AsyncCallback AsyncCallback;
protected:
class PathSegment {
@ -157,7 +159,7 @@ protected:
}
virtual oatpp::async::Action executeRequestAsync(oatpp::async::AbstractCoroutine* parentCoroutine,
RequestExecutor::AsyncCallback callback,
AsyncCallback callback,
const oatpp::base::String::PtrWrapper& method,
const PathPattern& pathPattern,
const std::shared_ptr<StringToParamMap>& headers,