mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 10:01:47 +00:00
refactor to more idiomatic RAII
* FairMQTransportFactoryZMQ: move the config invariant initialization to ctor * FairMQChannel: add new ctor that creates usable channel * FairMQSocket*: close sockets in dtor * FairMQTransportFactory*: terminate context in dtor * FairMQChannel: add Bind/Connect facades (for explicit control, e.g. timing)
This commit is contained in:
committed by
Mohammad Al-Turany
parent
87252edbe0
commit
3205e0c378
@@ -75,6 +75,31 @@ FairMQChannel::FairMQChannel(const string& type, const string& method, const str
|
||||
{
|
||||
}
|
||||
|
||||
FairMQChannel::FairMQChannel(const string& name, const string& type, std::shared_ptr<FairMQTransportFactory> factory)
|
||||
: fSocket(factory->CreateSocket(type, name, name)) // TODO whats id and whats name?
|
||||
, fType(type)
|
||||
, fMethod("unspecified")
|
||||
, fAddress("unspecified")
|
||||
, fTransport("default") // TODO refactor, either use string representation or enum type
|
||||
, fSndBufSize(1000)
|
||||
, fRcvBufSize(1000)
|
||||
, fSndKernelSize(0)
|
||||
, fRcvKernelSize(0)
|
||||
, fRateLogging(1)
|
||||
, fName(name)
|
||||
, fIsValid(false)
|
||||
, fPoller(nullptr)
|
||||
, fChannelCmdSocket(nullptr)
|
||||
, fTransportType(factory->GetType())
|
||||
, fTransportFactory(factory)
|
||||
, fNoBlockFlag(0)
|
||||
, fSndMoreFlag(0)
|
||||
, fMultipart(false)
|
||||
, fModified(true)
|
||||
, fReset(false)
|
||||
{
|
||||
}
|
||||
|
||||
FairMQChannel::FairMQChannel(const FairMQChannel& chan)
|
||||
: fSocket(nullptr)
|
||||
, fType(chan.fType)
|
||||
|
Reference in New Issue
Block a user