FairMQ
1.3.8
C++ Message Passing Framework
|
Classes | |
struct | ChannelConfigurationError |
Public Member Functions | |
FairMQChannel () | |
Default constructor. | |
FairMQChannel (const std::string &type, const std::string &method, const std::string &address) | |
FairMQChannel (const std::string &name, const std::string &type, std::shared_ptr< FairMQTransportFactory > factory) | |
FairMQChannel (const std::string &name, const std::string &type, const std::string &method, const std::string &address, std::shared_ptr< FairMQTransportFactory > factory) | |
FairMQChannel (const FairMQChannel &) | |
Copy Constructor. | |
FairMQChannel & | operator= (const FairMQChannel &) |
Assignment operator. | |
virtual | ~FairMQChannel () |
Default destructor. | |
FairMQSocket & | GetSocket () const |
bool | Bind (const std::string &address) |
bool | Connect (const std::string &address) |
std::string | GetChannelName () const |
std::string | GetName () const |
std::string | GetChannelPrefix () const |
std::string | GetPrefix () const |
std::string | GetChannelIndex () const |
std::string | GetIndex () const |
std::string | GetType () const |
std::string | GetMethod () const |
std::string | GetAddress () const |
std::string | GetTransportName () const |
int | GetSndBufSize () const |
int | GetRcvBufSize () const |
int | GetSndKernelSize () const |
int | GetRcvKernelSize () const |
int | GetLinger () const |
int | GetRateLogging () const |
int | GetPortRangeMin () const |
int | GetPortRangeMax () const |
bool | GetAutoBind () const |
void | UpdateType (const std::string &type) |
void | UpdateMethod (const std::string &method) |
void | UpdateAddress (const std::string &address) |
void | UpdateTransport (const std::string &transport) |
void | UpdateSndBufSize (const int sndBufSize) |
void | UpdateRcvBufSize (const int rcvBufSize) |
void | UpdateSndKernelSize (const int sndKernelSize) |
void | UpdateRcvKernelSize (const int rcvKernelSize) |
void | UpdateLinger (const int duration) |
void | UpdateRateLogging (const int rateLogging) |
void | UpdatePortRangeMin (const int minPort) |
void | UpdatePortRangeMax (const int maxPort) |
void | UpdateAutoBind (const bool autobind) |
void | UpdateChannelName (const std::string &name) |
void | UpdateName (const std::string &name) |
bool | IsValid () const |
bool | ValidateChannel () |
bool | Validate () |
void | Init () |
bool | ConnectEndpoint (const std::string &endpoint) |
bool | BindEndpoint (std::string &endpoint) |
void | ResetChannel () |
Resets the channel (requires validation to be used again). | |
int | Send (FairMQMessagePtr &msg, int sndTimeoutInMs=-1) |
int | Receive (FairMQMessagePtr &msg, int rcvTimeoutInMs=-1) |
int | SendAsync (FairMQMessagePtr &msg) __attribute__((deprecated("For non-blocking Send |
return fSocket | Send (msg, 0) |
int | ReceiveAsync (FairMQMessagePtr &msg) __attribute__((deprecated("For non-blocking Receive |
return fSocket | Receive (msg, 0) |
int64_t | Send (std::vector< FairMQMessagePtr > &msgVec, int sndTimeoutInMs=-1) |
int64_t | Receive (std::vector< FairMQMessagePtr > &msgVec, int rcvTimeoutInMs=-1) |
int64_t | SendAsync (std::vector< FairMQMessagePtr > &msgVec) __attribute__((deprecated("For non-blocking Send |
return fSocket | Send (msgVec, 0) |
int64_t | ReceiveAsync (std::vector< FairMQMessagePtr > &msgVec) __attribute__((deprecated("For non-blocking Receive |
return fSocket | Receive (msgVec, 0) |
int64_t | Send (FairMQParts &parts, int sndTimeoutInMs=-1) |
int64_t | Receive (FairMQParts &parts, int rcvTimeoutInMs=-1) |
int64_t | SendAsync (FairMQParts &parts) __attribute__((deprecated("For non-blocking Send |
int64_t | ReceiveAsync (FairMQParts &parts) __attribute__((deprecated("For non-blocking Receive |
unsigned long | GetBytesTx () const |
unsigned long | GetBytesRx () const |
unsigned long | GetMessagesTx () const |
unsigned long | GetMessagesRx () const |
auto | Transport () -> FairMQTransportFactory * |
template<typename... Args> | |
FairMQMessagePtr | NewMessage (Args &&... args) |
template<typename T > | |
FairMQMessagePtr | NewSimpleMessage (const T &data) |
template<typename T > | |
FairMQMessagePtr | NewStaticMessage (const T &data) |
Public Attributes | |
int use timeout version with timeout | of: Send(msg |
int use timeout version with timeout | timeout |
int64_t use timeout version with timeout | of: Send(msgVec |
int64_t use timeout version with timeout | timeout |
Friends | |
class | FairMQDevice |
FairMQChannel::FairMQChannel | ( | const std::string & | type, |
const std::string & | method, | ||
const std::string & | address | ||
) |
Constructor
type | Socket type (push/pull/pub/sub/spub/xsub/pair/req/rep/dealer/router/) |
method | Socket method (bind/connect) |
address | Network address to bind/connect to (e.g. "tcp://127.0.0.1:5555" or "ipc://abc") |
FairMQChannel::FairMQChannel | ( | const std::string & | name, |
const std::string & | type, | ||
std::shared_ptr< FairMQTransportFactory > | factory | ||
) |
Constructor
name | Channel name |
type | Socket type (push/pull/pub/sub/spub/xsub/pair/req/rep/dealer/router/) |
factory | TransportFactory |
FairMQChannel::FairMQChannel | ( | const std::string & | name, |
const std::string & | type, | ||
const std::string & | method, | ||
const std::string & | address, | ||
std::shared_ptr< FairMQTransportFactory > | factory | ||
) |
Constructor
name | Channel name |
type | Socket type (push/pull/pub/sub/spub/xsub/pair/req/rep/dealer/router/) |
method | Socket method (bind/connect) |
address | Network address to bind/connect to (e.g. "tcp://127.0.0.1:5555" or "ipc://abc") |
factory | TransportFactory |
string FairMQChannel::GetAddress | ( | ) | const |
Get socket address (e.g. "tcp://127.0.0.1:5555" or "ipc://abc")
bool FairMQChannel::GetAutoBind | ( | ) | const |
Set automatic binding (pick random port if bind fails)
|
inline |
Get channel index
|
inline |
Get channel name
|
inline |
Get channel prefix
int FairMQChannel::GetLinger | ( | ) | const |
Get linger duration (in milliseconds)
string FairMQChannel::GetMethod | ( | ) | const |
Get socket method
int FairMQChannel::GetPortRangeMax | ( | ) | const |
Get end of the port range for automatic binding
int FairMQChannel::GetPortRangeMin | ( | ) | const |
Get start of the port range for automatic binding
int FairMQChannel::GetRateLogging | ( | ) | const |
Get socket rate logging interval (in seconds)
int FairMQChannel::GetRcvBufSize | ( | ) | const |
Get socket receive buffer size (in number of messages)
int FairMQChannel::GetRcvKernelSize | ( | ) | const |
Get socket kernel transmit receive buffer size (in bytes)
int FairMQChannel::GetSndBufSize | ( | ) | const |
Get socket send buffer size (in number of messages)
int FairMQChannel::GetSndKernelSize | ( | ) | const |
Get socket kernel transmit send buffer size (in bytes)
string FairMQChannel::GetTransportName | ( | ) | const |
Get channel transport ("default", "zeromq", "nanomsg" or "shmem")
string FairMQChannel::GetType | ( | ) | const |
Get socket type
bool FairMQChannel::IsValid | ( | ) | const |
Checks if the configured channel settings are valid (checks the validity parameter, without running full validation (as oposed to ValidateChannel()))
|
inline |
Receives a message from the socket queue.
msg | Constant reference of unique_ptr to a FairMQMessage |
rcvTimeoutInMs | receive timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot receive) |
|
inline |
Receive a vector of messages
msgVec | message vector reference |
rcvTimeoutInMs | receive timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot receive) |
|
inline |
Receive FairMQParts
parts | FairMQParts reference |
rcvTimeoutInMs | receive timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot receive) |
|
inline |
Sends a message to the socket queue.
msg | Constant reference of unique_ptr to a FairMQMessage |
sndTimeoutInMs | send timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot send) |
|
inline |
Send a vector of messages
msgVec | message vector reference |
sndTimeoutInMs | send timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot send) |
|
inline |
Send FairMQParts
parts | FairMQParts reference |
sndTimeoutInMs | send timeout in ms. -1 will wait forever (or until interrupt (e.g. via state change)), 0 will not wait (return immediately if cannot send) |
void FairMQChannel::UpdateAddress | ( | const std::string & | address | ) |
Set socket address
Socket | address (e.g. "tcp://127.0.0.1:5555" or "ipc://abc") |
void FairMQChannel::UpdateAutoBind | ( | const bool | autobind | ) |
Set automatic binding (pick random port if bind fails)
autobind | true/false, true to enable automatic binding |
|
inline |
Set channel name
name | Arbitrary channel name |
void FairMQChannel::UpdateLinger | ( | const int | duration | ) |
Set linger duration (in milliseconds)
duration | linger duration (in milliseconds) |
void FairMQChannel::UpdateMethod | ( | const std::string & | method | ) |
Set socket method
method | Socket method (bind/connect) |
void FairMQChannel::UpdatePortRangeMax | ( | const int | maxPort | ) |
Set end of the port range for automatic binding
maxPort | end of the port range |
void FairMQChannel::UpdatePortRangeMin | ( | const int | minPort | ) |
Set start of the port range for automatic binding
minPort | start of the port range |
void FairMQChannel::UpdateRateLogging | ( | const int | rateLogging | ) |
Set socket rate logging interval (in seconds)
rateLogging | Socket rate logging interval (in seconds) |
void FairMQChannel::UpdateRcvBufSize | ( | const int | rcvBufSize | ) |
Set socket receive buffer size
rcvBufSize | Socket receive buffer size (in number of messages) |
void FairMQChannel::UpdateRcvKernelSize | ( | const int | rcvKernelSize | ) |
Set socket kernel transmit receive buffer size (in bytes)
rcvKernelSize | Socket receive buffer size (in bytes) |
void FairMQChannel::UpdateSndBufSize | ( | const int | sndBufSize | ) |
Set socket send buffer size
sndBufSize | Socket send buffer size (in number of messages) |
void FairMQChannel::UpdateSndKernelSize | ( | const int | sndKernelSize | ) |
Set socket kernel transmit send buffer size (in bytes)
sndKernelSize | Socket send buffer size (in bytes) |
void FairMQChannel::UpdateTransport | ( | const std::string & | transport | ) |
Set channel transport
transport | transport string ("default", "zeromq", "nanomsg" or "shmem") |
void FairMQChannel::UpdateType | ( | const std::string & | type | ) |
Set socket type
type | Socket type (push/pull/pub/sub/spub/xsub/pair/req/rep/dealer/router/) |
bool FairMQChannel::Validate | ( | ) |
Validates channel configuration
|
inline |
Validates channel configuration