|
rogue
|
ZeroMQ server for Rogue control, request/reply, and publish updates. More...
#include <ZmqServer.h>
Public Member Functions | |
| ZmqServer (const std::string &addr, uint16_t port) | |
| Constructs a ZeroMQ server. | |
| virtual | ~ZmqServer () |
| Destroys server and stops worker threads/sockets. | |
| void | publish (boost::python::object data) |
| Publishes an update payload on the publish socket. | |
| virtual boost::python::object | doRequest (boost::python::object data) |
| Handles one binary request payload. | |
| virtual std::string | doString (const std::string &data) |
| Handles one string request payload. | |
| uint16_t | port () |
| Returns currently bound base port. | |
| void | stop () |
| Stops server threads and closes sockets. | |
| void | start () |
| Starts server, binds sockets, and launches worker threads. | |
Static Public Member Functions | |
| static std::shared_ptr< rogue::interfaces::ZmqServer > | create (const std::string &addr, uint16_t port) |
| Creates a ZeroMQ server. | |
| static void | setup_python () |
| Registers Python bindings for this class. | |
ZeroMQ server for Rogue control, request/reply, and publish updates.
ZmqServer exposes three sockets:
basePort for asynchronous update messages.basePort + 1.basePort + 2.start() binds sockets and launches worker threads for binary and string request handling. If constructed with port == 0, the server scans for an available base port starting at 9099 in increments of 4.
Definition at line 47 of file ZmqServer.h.
| rogue::interfaces::ZmqServer::ZmqServer | ( | const std::string & | addr, |
| uint16_t | port | ||
| ) |
Constructs a ZeroMQ server.
This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.
| addr | Bind address/interface. |
| port | Base port. Use 0 for auto-allocation. |
Definition at line 58 of file ZmqServer.cpp.
|
virtual |
Destroys server and stops worker threads/sockets.
Definition at line 67 of file ZmqServer.cpp.
|
static |
Creates a ZeroMQ server.
Parameter semantics are identical to the constructor; see ZmqServer() for bind/setup behavior details. This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.
| addr | Bind address/interface. |
| port | Base port. Use 0 for auto-allocation. |
Description:
This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms
Definition at line 37 of file ZmqServer.cpp.
|
virtual |
Handles one binary request payload.
| data | Request payload as Python object. |
Reimplemented in rogue::interfaces::ZmqServerWrap.
Definition at line 234 of file ZmqServer.cpp.
|
virtual |
Handles one string request payload.
| data | Request payload string. |
Reimplemented in rogue::interfaces::ZmqServerWrap.
Definition at line 211 of file ZmqServer.cpp.
| uint16_t rogue::interfaces::ZmqServer::port | ( | ) |
Returns currently bound base port.
Definition at line 207 of file ZmqServer.cpp.
| void rogue::interfaces::ZmqServer::publish | ( | boost::python::object | data | ) |
Publishes an update payload on the publish socket.
| data | Python object exposing a readable buffer. |
Definition at line 217 of file ZmqServer.cpp.
|
static |
Registers Python bindings for this class.
Setup class in python.
Definition at line 43 of file ZmqServer.cpp.
| void rogue::interfaces::ZmqServer::start | ( | ) |
Starts server, binds sockets, and launches worker threads.
Definition at line 71 of file ZmqServer.cpp.
| void rogue::interfaces::ZmqServer::stop | ( | ) |
Stops server threads and closes sockets.
Definition at line 113 of file ZmqServer.cpp.