FairMQ: Remove unused Attach method and unused socket flags

This commit is contained in:
Dennis Klein
2018-02-16 19:38:59 +01:00
committed by Mohammad Al-Turany
parent 3785c0e369
commit 3670dd8835
12 changed files with 117 additions and 183 deletions

View File

@@ -1,16 +1,10 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2014-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
/**
* FairMQSocketZMQ.cxx
*
* @since 2012-12-05
* @author D. Klein, A. Rybalchenko
*/
#include "FairMQSocketZMQ.h"
#include "FairMQMessageZMQ.h"
@@ -23,16 +17,13 @@ using namespace std;
atomic<bool> FairMQSocketZMQ::fInterrupted(false);
FairMQSocketZMQ::FairMQSocketZMQ(const string& type, const string& name, const string& id /*= ""*/, void* context)
: FairMQSocket(ZMQ_SNDMORE, ZMQ_RCVMORE, ZMQ_DONTWAIT)
, fSocket(nullptr)
, fId()
: fSocket(nullptr)
, fId(id + "." + name + "." + type)
, fBytesTx(0)
, fBytesRx(0)
, fMessagesTx(0)
, fMessagesRx(0)
{
fId = id + "." + name + "." + type;
assert(context);
fSocket = zmq_socket(context, GetConstant(type));
@@ -111,6 +102,16 @@ void FairMQSocketZMQ::Connect(const string& address)
}
}
int FairMQSocketZMQ::Send(FairMQMessagePtr& msg) { return Send(msg, 0); }
int FairMQSocketZMQ::SendAsync(FairMQMessagePtr& msg) { return Send(msg, ZMQ_DONTWAIT); }
int FairMQSocketZMQ::Receive(FairMQMessagePtr& msg) { return Receive(msg, 0); }
int FairMQSocketZMQ::ReceiveAsync(FairMQMessagePtr& msg) { return Receive(msg, ZMQ_DONTWAIT); }
int64_t FairMQSocketZMQ::Send(std::vector<std::unique_ptr<FairMQMessage>>& msgVec) { return Send(msgVec, 0); }
int64_t FairMQSocketZMQ::SendAsync(std::vector<std::unique_ptr<FairMQMessage>>& msgVec) { return Send(msgVec, ZMQ_DONTWAIT); }
int64_t FairMQSocketZMQ::Receive(std::vector<std::unique_ptr<FairMQMessage>>& msgVec) { return Receive(msgVec, 0); }
int64_t FairMQSocketZMQ::ReceiveAsync(std::vector<std::unique_ptr<FairMQMessage>>& msgVec) { return Receive(msgVec, ZMQ_DONTWAIT); }
int FairMQSocketZMQ::Send(FairMQMessagePtr& msg, const int flags)
{
int nbytes = -1;
@@ -202,7 +203,6 @@ int64_t FairMQSocketZMQ::Send(vector<FairMQMessagePtr>& msgVec, const int flags)
while (true)
{
totalSize = 0;
nbytes = -1;
repeat = false;
for (unsigned int i = 0; i < vecSize; ++i)