Turi Create
4.0
|
#include <core/system/nanosockets/subscribe_socket.hpp>
Public Member Functions | |
subscribe_socket (callback_type callback) | |
void | close () |
void | connect (std::string endpoint) |
void | disconnect (std::string endpoint) |
void | subscribe (std::string topic) |
void | unsubscribe (std::string topic) |
Constructs a subscribe socket.
The subscribe socket binds to at least one endpoint bound by a publish socket (publish_socket). Everything the publish socket publishes will be received by the callback. You can register interest in prefix matches of the message.
Definition at line 37 of file subscribe_socket.hpp.
turi::nanosockets::subscribe_socket::subscribe_socket | ( | callback_type | callback | ) |
Constructs a subscribe socket.
callback | The function used to process replies. |
keyval can be NULL in which case all "connect/disconnect" calls must refer to a ZeroMQ endpoints.
void turi::nanosockets::subscribe_socket::close | ( | ) |
Closes the socket. Once closed. It cannot be opened again
void turi::nanosockets::subscribe_socket::connect | ( | std::string | endpoint | ) |
the argument must be a Nanomsg endpoint to connect to.
void turi::nanosockets::subscribe_socket::disconnect | ( | std::string | endpoint | ) |
Disconnects from a given endpoint.
void turi::nanosockets::subscribe_socket::subscribe | ( | std::string | topic | ) |
Subscribes to a topic. A topic is any message prefix. Only messages with prefix matching the topic will be received.
void turi::nanosockets::subscribe_socket::unsubscribe | ( | std::string | topic | ) |
Unsubscribes from a topic. A topic is any message prefix. See