PhoenixZMQ  2.0.0
Library which integrates zeromq use in Phoenix
PZmqBackend.h File Reference
#include "PSocketFlag.h"
#include "phoenix_data_stream.h"
#include "phoenix_zmq.h"
+ Include dependency graph for PZmqBackend.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PZmqBackend
 Backend to use ZMQ library with PAbtractSocket. More...
 
struct  PZmqParam
 Set of parameters to be passed to create a socket with zmq backend. More...
 

Functions

PZmqParam pzmq_createParamClient (const std::string &address, size_t port, zmq::context_t *context=NULL, int type=ZMQ_PULL, int nbBufferMessage=10000, int bufferSizeByte=1000000, size_t threadAffinity=0lu, ssize_t dataRate=200000l)
 Create param for a client socket. More...
 
PZmqParam pzmq_createParamServer (const std::string &address, size_t port, zmq::context_t *context=NULL, int type=ZMQ_PUSH, int nbBufferMessage=10000, int bufferSizeByte=1000000, size_t threadAffinity=0lu, ssize_t dataRate=200000l)
 Create param for a client socket. More...
 

Function Documentation

◆ pzmq_createParamClient()

PZmqParam pzmq_createParamClient ( const std::string &  address,
size_t  port,
zmq::context_t *  context,
int  type,
int  nbBufferMessage,
int  bufferSizeByte,
size_t  threadAffinity,
ssize_t  dataRate 
)

Create param for a client socket.

Parameters
address: address of the server to be connected to
port: port to be used
context: zmq context where to create socket
type: type of the connection (ZMQ_PULL, ZMQ_PUSH, etc)
nbBufferMessage: number of messages to be buffered
bufferSizeByte: size of the zmq buffer in bytes
threadAffinity: bit mask which determines which threads from the 0MQ I/O thread pool associated with the socket's context shall handle newly created connections (1 : means first, 2 : means second, 3 : means first and second, etc)
dataRate: expected data rate (in kilobytes per second)
Returns
corresponding PZmqParam

Definition at line 20 of file PZmqBackend.cpp.

22 {
23  PZmqParam param;
24  param.address = address;
25  param.port = port;
26  param.context = context;
27  param.type = type;
28  param.nbBufferMessage = nbBufferMessage;
29  param.bufferSizeByte = bufferSizeByte;
30  param.threadAffinity = threadAffinity;
31  param.dataRate = dataRate;
32  return param;
33 }
Set of parameters to be passed to create a socket with zmq backend.
Definition: PZmqBackend.h:15
zmq::context_t * context
Context.
Definition: PZmqBackend.h:17
ssize_t dataRate
Data rate.
Definition: PZmqBackend.h:31
int nbBufferMessage
Number of messages in the buffer.
Definition: PZmqBackend.h:25
int bufferSizeByte
Size of the message buffer in bytes.
Definition: PZmqBackend.h:27
size_t port
Connection port.
Definition: PZmqBackend.h:21
int type
Socket type.
Definition: PZmqBackend.h:23
size_t threadAffinity
Mask of threads which deal with reconnection.
Definition: PZmqBackend.h:29
std::string address
Host address.
Definition: PZmqBackend.h:19

References PZmqParam::address, PZmqParam::bufferSizeByte, PZmqParam::context, PZmqParam::dataRate, PZmqParam::nbBufferMessage, PZmqParam::port, PZmqParam::threadAffinity, and PZmqParam::type.

Referenced by PZmqBackend::client().

+ Here is the caller graph for this function:

◆ pzmq_createParamServer()

PZmqParam pzmq_createParamServer ( const std::string &  address,
size_t  port,
zmq::context_t *  context,
int  type,
int  nbBufferMessage,
int  bufferSizeByte,
size_t  threadAffinity,
ssize_t  dataRate 
)

Create param for a client socket.

Parameters
address: address of the server to be connected to
port: port to be used
context: zmq context where to create socket
type: type of the connection (ZMQ_PULL, ZMQ_PUSH, etc)
nbBufferMessage: number of messages to be buffered
bufferSizeByte: size of the zmq buffer in bytes
threadAffinity: bit mask which determines which threads from the 0MQ I/O thread pool associated with the socket's context shall handle newly created connections (1 : means first, 2 : means second, 3 : means first and second, etc)
dataRate: expected data rate (in kilobytes per second)
Returns
corresponding PZmqParam

Definition at line 46 of file PZmqBackend.cpp.

48 {
49  PZmqParam param;
50  param.address = address;
51  param.port = port;
52  param.context = context;
53  param.type = type;
54  param.nbBufferMessage = nbBufferMessage;
55  param.bufferSizeByte = bufferSizeByte;
56  param.threadAffinity = threadAffinity;
57  param.dataRate = dataRate;
58  return param;
59 }

References PZmqParam::address, PZmqParam::bufferSizeByte, PZmqParam::context, PZmqParam::dataRate, PZmqParam::nbBufferMessage, PZmqParam::port, PZmqParam::threadAffinity, and PZmqParam::type.

Referenced by PZmqBackend::server().

+ Here is the caller graph for this function: