summaryrefslogtreecommitdiff
path: root/src/third_party/asio-master/asio/include/asio/detail
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2018-02-20 14:33:42 -0500
committerJonathan Reams <jbreams@mongodb.com>2018-03-02 11:07:01 -0500
commitb2d8bd06318e1fddf4f1579084bbda4fb556c176 (patch)
treef591c41a0100dc85b51177396e80b946822aa712 /src/third_party/asio-master/asio/include/asio/detail
parent975d539ae068bd27ebb478b6f3673b89d2ad6beb (diff)
downloadmongo-b2d8bd06318e1fddf4f1579084bbda4fb556c176.tar.gz
SERVER-33300 Integrate TransportLayer with DBClient
Diffstat (limited to 'src/third_party/asio-master/asio/include/asio/detail')
-rw-r--r--src/third_party/asio-master/asio/include/asio/detail/impl/socket_ops.ipp11
-rw-r--r--src/third_party/asio-master/asio/include/asio/detail/reactive_socket_service.hpp4
-rw-r--r--src/third_party/asio-master/asio/include/asio/detail/socket_ops.hpp2
-rw-r--r--src/third_party/asio-master/asio/include/asio/detail/win_iocp_socket_service.hpp4
4 files changed, 14 insertions, 7 deletions
diff --git a/src/third_party/asio-master/asio/include/asio/detail/impl/socket_ops.ipp b/src/third_party/asio-master/asio/include/asio/detail/impl/socket_ops.ipp
index 2f89889fac8..58ad04ea66f 100644
--- a/src/third_party/asio-master/asio/include/asio/detail/impl/socket_ops.ipp
+++ b/src/third_party/asio-master/asio/include/asio/detail/impl/socket_ops.ipp
@@ -491,7 +491,7 @@ int connect(socket_type s, const socket_addr_type* addr,
}
void sync_connect(socket_type s, const socket_addr_type* addr,
- std::size_t addrlen, asio::error_code& ec)
+ std::size_t addrlen, int timeout_ms, asio::error_code& ec)
{
// Perform the connect operation.
socket_ops::connect(s, addr, addrlen, ec);
@@ -503,8 +503,15 @@ void sync_connect(socket_type s, const socket_addr_type* addr,
}
// Wait for socket to become ready.
- if (socket_ops::poll_connect(s, -1, ec) < 0)
+ int res = socket_ops::poll_connect(s, timeout_ms, ec);
+ if (res < 0)
+ return;
+
+ if (res == 0)
+ {
+ ec = asio::error::timed_out;
return;
+ }
// Get the error code from the connect operation.
int connect_error = 0;
diff --git a/src/third_party/asio-master/asio/include/asio/detail/reactive_socket_service.hpp b/src/third_party/asio-master/asio/include/asio/detail/reactive_socket_service.hpp
index b7b264806a9..ef9a9366a85 100644
--- a/src/third_party/asio-master/asio/include/asio/detail/reactive_socket_service.hpp
+++ b/src/third_party/asio-master/asio/include/asio/detail/reactive_socket_service.hpp
@@ -486,10 +486,10 @@ public:
// Connect the socket to the specified endpoint.
asio::error_code connect(implementation_type& impl,
- const endpoint_type& peer_endpoint, asio::error_code& ec)
+ const endpoint_type& peer_endpoint, int timeout_ms, asio::error_code& ec)
{
socket_ops::sync_connect(impl.socket_,
- peer_endpoint.data(), peer_endpoint.size(), ec);
+ peer_endpoint.data(), peer_endpoint.size(), timeout_ms, ec);
return ec;
}
diff --git a/src/third_party/asio-master/asio/include/asio/detail/socket_ops.hpp b/src/third_party/asio-master/asio/include/asio/detail/socket_ops.hpp
index b1fe32af429..2f2a1c38552 100644
--- a/src/third_party/asio-master/asio/include/asio/detail/socket_ops.hpp
+++ b/src/third_party/asio-master/asio/include/asio/detail/socket_ops.hpp
@@ -104,7 +104,7 @@ ASIO_DECL int connect(socket_type s, const socket_addr_type* addr,
std::size_t addrlen, asio::error_code& ec);
ASIO_DECL void sync_connect(socket_type s, const socket_addr_type* addr,
- std::size_t addrlen, asio::error_code& ec);
+ std::size_t addrlen, int timeout_ms, asio::error_code& ec);
#if defined(ASIO_HAS_IOCP)
diff --git a/src/third_party/asio-master/asio/include/asio/detail/win_iocp_socket_service.hpp b/src/third_party/asio-master/asio/include/asio/detail/win_iocp_socket_service.hpp
index ab099f6eab1..21d3f24fa77 100644
--- a/src/third_party/asio-master/asio/include/asio/detail/win_iocp_socket_service.hpp
+++ b/src/third_party/asio-master/asio/include/asio/detail/win_iocp_socket_service.hpp
@@ -562,10 +562,10 @@ public:
// Connect the socket to the specified endpoint.
asio::error_code connect(implementation_type& impl,
- const endpoint_type& peer_endpoint, asio::error_code& ec)
+ const endpoint_type& peer_endpoint, int timeout_ms, asio::error_code& ec)
{
socket_ops::sync_connect(impl.socket_,
- peer_endpoint.data(), peer_endpoint.size(), ec);
+ peer_endpoint.data(), peer_endpoint.size(), timeout_ms, ec);
return ec;
}