ReCodEx - Task Broker
ReCodEx is complex programmer testing solution, primary targeted to technical universities. It's highly customizable and based on modern technologies.
|
#include <socket_wrapper_base.h>
Public Member Functions | |
socket_wrapper_base (std::shared_ptr< zmq::context_t > context, zmq::socket_type type, const std::string &addr, const bool bound) | |
virtual | ~socket_wrapper_base () |
zmq_pollitem_t | get_pollitem () |
virtual void | initialize () |
void | restart () |
virtual bool | send_message (const message_container &)=0 |
virtual bool | receive_message (message_container &)=0 |
Protected Attributes | |
zmq::socket_t | socket_ |
const std::string | addr_ |
const bool | bound_ |
A wrapper for ZeroMQ sockets that also contains the address the socket should use, so that we can easily restart the connection. Socket wrappers should also hide all technical details of the underlying sockets, such as empty delimiter frames.
Definition at line 14 of file socket_wrapper_base.h.
socket_wrapper_base::socket_wrapper_base | ( | std::shared_ptr< zmq::context_t > | context, |
zmq::socket_type | type, | ||
const std::string & | addr, | ||
const bool | bound | ||
) |
context | A ZeroMQ context used to create the socket |
type | Type of the socket |
addr | Address used by the socket |
bound | True if the socket should bind to an address, false if it connects |
Definition at line 4 of file socket_wrapper_base.cpp.
|
virtual |
A virtual destructor
Definition at line 11 of file socket_wrapper_base.cpp.
zmq_pollitem_t socket_wrapper_base::get_pollitem | ( | ) |
Get the pollitem structure used to poll the wrapped socket
Definition at line 15 of file socket_wrapper_base.cpp.
|
virtual |
Connect or bind the socket
Definition at line 31 of file socket_wrapper_base.cpp.
|
pure virtual |
Receive a message from the socket
Implemented in router_socket_wrapper.
void socket_wrapper_base::restart | ( | ) |
Destroy the wrapped socket and connect/bind again with a new one
Definition at line 20 of file socket_wrapper_base.cpp.
|
pure virtual |
Send a message through the socket
Implemented in router_socket_wrapper.
|
protected |
An address to connect/bind to
Definition at line 25 of file socket_wrapper_base.h.
|
protected |
True if the socket should bind to an address, false if it connects
Definition at line 30 of file socket_wrapper_base.h.
|
protected |
The wrapped socket
Definition at line 20 of file socket_wrapper_base.h.