Set pointer to factory also when receiving multi-part

This commit is contained in:
mkrzewic
2018-11-27 13:23:42 +01:00
committed by Alexey Rybalchenko
parent 25fcf13985
commit cc0c525e0d
18 changed files with 45 additions and 29 deletions

View File

@@ -20,8 +20,9 @@ using namespace fair::mq;
atomic<bool> FairMQSocketZMQ::fInterrupted(false);
FairMQSocketZMQ::FairMQSocketZMQ(const string& type, const string& name, const string& id /*= ""*/, void* context)
: fSocket(nullptr)
FairMQSocketZMQ::FairMQSocketZMQ(const string& type, const string& name, const string& id /*= ""*/, void* context, FairMQTransportFactory* fac)
: FairMQSocket{fac}
, fSocket(nullptr)
, fId(id + "." + name + "." + type)
, fBytesTx(0)
, fBytesRx(0)
@@ -314,7 +315,7 @@ int64_t FairMQSocketZMQ::Receive(vector<FairMQMessagePtr>& msgVec, const int tim
do
{
unique_ptr<FairMQMessage> part(new FairMQMessageZMQ());
unique_ptr<FairMQMessage> part(new FairMQMessageZMQ(GetTransport()));
int nbytes = zmq_msg_recv(static_cast<FairMQMessageZMQ*>(part.get())->GetMessage(), fSocket, flags);
if (nbytes >= 0)