From 02e15116679cc8f0efd644bf77eff2ed1111a260 Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Mon, 25 Feb 2019 15:01:37 +0100 Subject: [PATCH] Fix issues after rebase --- fairmq/ofi/Socket.cxx | 18 ++++++++++++++++-- fairmq/ofi/TransportFactory.cxx | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/fairmq/ofi/Socket.cxx b/fairmq/ofi/Socket.cxx index a28a9422..76bfca93 100644 --- a/fairmq/ofi/Socket.cxx +++ b/fairmq/ofi/Socket.cxx @@ -186,8 +186,8 @@ auto Socket::BindDataEndpoint() -> void LOG(debug) << "OFI transport (" << fId << "): data band bound to " << fLocalAddr; } -auto Socket::Connect(const string& address) -> void -{ +auto Socket::Connect(const string& address) -> bool +try { fRemoteAddr = Context::VerifyAddress(address); if (fRemoteAddr.Protocol == "verbs") { fNeedOfiMemoryRegistration = true; @@ -201,6 +201,20 @@ auto Socket::Connect(const string& address) -> void boost::asio::post(fIoStrand, std::bind(&Socket::SendQueueReader, this)); boost::asio::post(fIoStrand, std::bind(&Socket::RecvControlQueueReader, this)); + + return true; +} +// TODO catch the correct ofi error +catch (const SilentSocketError& e) +{ + // do not print error in this case, this is handled by FairMQDevice + // in case no connection could be established after trying a number of random ports from a range. + return false; +} +catch (const SocketError& e) +{ + LOG(error) << "OFI transport: " << e.what(); + return false; } auto Socket::ConnectControlEndpoint() -> void diff --git a/fairmq/ofi/TransportFactory.cxx b/fairmq/ofi/TransportFactory.cxx index 763f4847..0c2124f7 100644 --- a/fairmq/ofi/TransportFactory.cxx +++ b/fairmq/ofi/TransportFactory.cxx @@ -61,7 +61,7 @@ auto TransportFactory::CreateMessage(UnmanagedRegionPtr& region, auto TransportFactory::CreateSocket(const string& type, const string& name) -> SocketPtr { - return SocketPtr{new Socket(fContext, type, name, GetId(), this)}; + return SocketPtr{new Socket(fContext, type, name, GetId())}; } auto TransportFactory::CreatePoller(const vector& /*channels*/) const -> PollerPtr