Use connectExernal in INetworkConnections::connect
This commit is contained in:
parent
1dfa2acb93
commit
a7202a5b42
|
@ -187,9 +187,9 @@ TEST_CASE("fdbrpc/SimExternalClient") {
|
|||
state std::thread serverThread([] { return testEchoServer(); });
|
||||
state UnsentPacketQueue packetQueue;
|
||||
state Reference<IConnection> externalConn;
|
||||
state const NetworkAddress serverAddress = NetworkAddress(IPAddress::parse("127.0.0.1").get(), testEchoServerPort);
|
||||
loop {
|
||||
Reference<IConnection> _externalConn = wait(INetworkConnections::net()->connectExternal(serverAddress));
|
||||
Reference<IConnection> _externalConn =
|
||||
wait(INetworkConnections::net()->connect("localhost", std::to_string(testEchoServerPort)));
|
||||
if (_externalConn.isValid()) {
|
||||
externalConn = std::move(_externalConn);
|
||||
break;
|
||||
|
|
|
@ -161,10 +161,10 @@ Future<Reference<IConnection>> INetworkConnections::connect( const std::string &
|
|||
|
||||
// Wait for the endpoint to return, then wait for connect(endpoint) and return it.
|
||||
// Template types are being provided explicitly because they can't be automatically deduced for some reason.
|
||||
return mapAsync<NetworkAddress, std::function<Future<Reference<IConnection>>(NetworkAddress const &)>, Reference<IConnection> >
|
||||
(pickEndpoint, [=](NetworkAddress const &addr) -> Future<Reference<IConnection>> {
|
||||
return connect(addr, host);
|
||||
});
|
||||
return mapAsync<NetworkAddress, std::function<Future<Reference<IConnection>>(NetworkAddress const&)>,
|
||||
Reference<IConnection>>(
|
||||
pickEndpoint,
|
||||
[=](NetworkAddress const& addr) -> Future<Reference<IConnection>> { return connectExternal(addr, host); });
|
||||
}
|
||||
|
||||
IUDPSocket::~IUDPSocket() {}
|
||||
|
|
Loading…
Reference in New Issue