mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
FairMQ: Introduce callbacks for the FairMQUnmanagedRegion.
Callbacks are called when the data buffer of the message assiciated with the corresponding region is no longer needed by the transport. Example in examples/advanced/Region/
This commit is contained in:
committed by
Mohammad Al-Turany
parent
378c47c5e5
commit
58a312b730
@@ -119,7 +119,6 @@ void FairMQDevice::InitWrapper()
|
||||
}
|
||||
|
||||
FairMQMessagePtr msg(fTransportFactory->CreateMessage());
|
||||
msg->SetDeviceId(fId);
|
||||
}
|
||||
|
||||
// Containers to store the uninitialized channels.
|
||||
@@ -131,18 +130,14 @@ void FairMQDevice::InitWrapper()
|
||||
{
|
||||
for (auto vi = mi.second.begin(); vi != mi.second.end(); ++vi)
|
||||
{
|
||||
if (vi->fModified)
|
||||
{
|
||||
if (vi->fReset)
|
||||
{
|
||||
vi->fSocket->Close();
|
||||
vi->fSocket = nullptr;
|
||||
|
||||
vi->fPoller = nullptr;
|
||||
|
||||
vi->fChannelCmdSocket->Close();
|
||||
vi->fChannelCmdSocket = nullptr;
|
||||
}
|
||||
// if (vi->fModified)
|
||||
// {
|
||||
// if (vi->fReset)
|
||||
// {
|
||||
// vi->fSocket.reset();
|
||||
// vi->fPoller.reset();
|
||||
// vi->fChannelCmdSocket.reset();
|
||||
// }
|
||||
// set channel name: name + vector index
|
||||
vi->fName = fair::mq::tools::ToString(mi.first, "[", vi - (mi.second).begin(), "]");
|
||||
|
||||
@@ -176,7 +171,7 @@ void FairMQDevice::InitWrapper()
|
||||
LOG(ERROR) << "Cannot update configuration. Socket method (bind/connect) not specified.";
|
||||
throw runtime_error("Cannot update configuration. Socket method (bind/connect) not specified.");
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,7 +800,6 @@ shared_ptr<FairMQTransportFactory> FairMQDevice::AddTransport(const string& tran
|
||||
}
|
||||
|
||||
FairMQMessagePtr msg(tr->CreateMessage());
|
||||
msg->SetDeviceId(fId);
|
||||
|
||||
return move(tr);
|
||||
}
|
||||
@@ -1064,14 +1058,10 @@ void FairMQDevice::Reset()
|
||||
// iterate over the channels vector
|
||||
for (auto& vi : mi.second)
|
||||
{
|
||||
vi.fReset = true;
|
||||
// vi.fSocket->Close();
|
||||
// vi.fSocket = nullptr;
|
||||
|
||||
// vi.fPoller = nullptr;
|
||||
|
||||
// vi.fChannelCmdSocket->Close();
|
||||
// vi.fChannelCmdSocket = nullptr;
|
||||
// vi.fReset = true;
|
||||
vi.fSocket.reset();
|
||||
vi.fPoller.reset();
|
||||
vi.fChannelCmdSocket.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user