coral
A C++ library for distributed co-simulation
|
A client socket for communication with a single server node. More...
#include "coral/net/zmqx.hpp"
Public Member Functions | |
ReqSocket () | |
Constructs a new, unconnected socket. | |
void | Connect (const coral::net::Endpoint &server) |
Connects to a server. More... | |
void | Bind (const coral::net::Endpoint &localEndpoint) |
Binds to an endpoint to accept an incoming direct connection from a server. More... | |
void | Close () |
Disconnects and/or unbinds the socket. More... | |
void | Send (std::vector< zmq::message_t > &msg) |
Sends a request. More... | |
void | Receive (std::vector< zmq::message_t > &msg) |
Receives a reply. More... | |
zmq::socket_t & | Socket () |
The underlying ZMQ socket. More... | |
A client socket for communication with a single server node.
This is similar to a ZeroMQ REQ socket, except that it is not limited to a strict alternating send/receive sequence.
void coral::net::zmqx::ReqSocket::Bind | ( | const coral::net::Endpoint & | localEndpoint | ) |
Binds to an endpoint to accept an incoming direct connection from a server.
This function may only be called if the socket is not already connected or bound.
void coral::net::zmqx::ReqSocket::Close | ( | ) |
Disconnects and/or unbinds the socket.
If the socket is not connected or bound, this function has no effect.
void coral::net::zmqx::ReqSocket::Connect | ( | const coral::net::Endpoint & | server | ) |
Connects to a server.
This function may only be called if the socket is not already connected or bound.
void coral::net::zmqx::ReqSocket::Receive | ( | std::vector< zmq::message_t > & | msg | ) |
Receives a reply.
This function may only be called if the socket is connected or bound.
void coral::net::zmqx::ReqSocket::Send | ( | std::vector< zmq::message_t > & | msg | ) |
Sends a request.
This function may only be called if the socket is connected or bound.
zmq::socket_t& coral::net::zmqx::ReqSocket::Socket | ( | ) |
The underlying ZMQ socket.
This reference is only valid after the socket has been connected/bound. The socket is of type DEALER.