diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2021-11-05 03:32:05 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-05 04:11:50 +0000 |
commit | 4dce840273127d4b2c86f8c790e081f19e44887a (patch) | |
tree | 5d0c9b875bbfdaaa3332b7305a53ef6245a50898 /src/mongo/util/net | |
parent | 32064f88ed311247af2b707a3560e57543aebcc8 (diff) | |
download | mongo-4dce840273127d4b2c86f8c790e081f19e44887a.tar.gz |
SERVER-61095 improvements to transport_layer_asio_test (again)
Diffstat (limited to 'src/mongo/util/net')
-rw-r--r-- | src/mongo/util/net/sock.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/net/sock.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/util/net/sock.cpp b/src/mongo/util/net/sock.cpp index 35776fe4c73..3a42470524a 100644 --- a/src/mongo/util/net/sock.cpp +++ b/src/mongo/util/net/sock.cpp @@ -299,13 +299,13 @@ SSLPeerInfo Socket::doSSLHandshake(const char* firstBytes, int len) { #endif -bool Socket::connect(SockAddr& remote) { +bool Socket::connect(const SockAddr& remote) { const Milliseconds connectTimeoutMillis(static_cast<int64_t>( _timeout > 0 ? std::min(kMaxConnectTimeoutMS, (_timeout * 1000)) : kMaxConnectTimeoutMS)); return connect(remote, connectTimeoutMillis); } -bool Socket::connect(SockAddr& remote, Milliseconds connectTimeoutMillis) { +bool Socket::connect(const SockAddr& remote, Milliseconds connectTimeoutMillis) { _remote = remote; _fd = ::socket(remote.getType(), SOCK_STREAM, 0); diff --git a/src/mongo/util/net/sock.h b/src/mongo/util/net/sock.h index 2548a46804c..7257e5e16f6 100644 --- a/src/mongo/util/net/sock.h +++ b/src/mongo/util/net/sock.h @@ -109,12 +109,12 @@ public: * an error, or due to a timeout on connection, or due to the system socket deciding the * socket is invalid. */ - bool connect(SockAddr& remote, Milliseconds connectTimeoutMillis); + bool connect(const SockAddr& remote, Milliseconds connectTimeoutMillis); /** * Connect using a default connect timeout of min(_timeout * 1000, kMaxConnectTimeoutMS) */ - bool connect(SockAddr& remote); + bool connect(const SockAddr& remote); void close(); void send(const char* data, int len, const char* context); |