Refactor the transport interface

- give transport Initialize() method with access to device config.
 - avoid using global context in the transport.
 - simplify shutdown procedure (no need for extra thread).
This commit is contained in:
Alexey Rybalchenko
2017-04-04 17:14:37 +02:00
committed by Mohammad Al-Turany
parent d7eb692951
commit 5aaf27bf02
25 changed files with 278 additions and 358 deletions

View File

@@ -31,7 +31,7 @@ using namespace std;
atomic<bool> FairMQSocketNN::fInterrupted(false);
FairMQSocketNN::FairMQSocketNN(const string& type, const string& name, const int numIoThreads, const string& id /*= ""*/)
FairMQSocketNN::FairMQSocketNN(const string& type, const string& name, const string& id /*= ""*/)
: FairMQSocket(0, 0, NN_DONTWAIT)
, fSocket(-1)
, fId()
@@ -42,11 +42,6 @@ FairMQSocketNN::FairMQSocketNN(const string& type, const string& name, const int
{
fId = id + "." + name + "." + type;
if (numIoThreads > 1)
{
LOG(INFO) << "number of I/O threads is not used in nanomsg";
}
if (type == "router" || type == "dealer")
{
// Additional info about using the sockets ROUTER and DEALER with nanomsg can be found in:
@@ -370,11 +365,6 @@ void FairMQSocketNN::Close()
nn_close(fSocket);
}
void FairMQSocketNN::Terminate()
{
nn_term();
}
void FairMQSocketNN::Interrupt()
{
fInterrupted = true;