10 #include "TypedBrokerServer.hpp"
19 #ifdef HELICS_ENABLE_ZMQ_CORE
36 explicit zmqBrokerServer(std::string_view server_name): name_(server_name) {}
39 const std::shared_ptr<TypedBrokerServer>& ptr)
override;
43 virtual void processArgs(std::string_view args)
override;
44 void enableZmqServer(
bool enabled) { zmq_enabled_ = enabled; }
45 void enableZmqSsServer(
bool enabled) { zmqss_enabled_ = enabled; }
48 struct zmqServerData {
53 #ifdef HELICS_ENABLE_ZMQ_CORE
54 std::pair<std::unique_ptr<zmq::socket_t>,
int> loadZMQsocket(zmq::context_t& ctx);
55 std::pair<std::unique_ptr<zmq::socket_t>,
int> loadZMQSSsocket(zmq::context_t& ctx);
57 static zmqServerData generateServerData(
int portNumber,
int skip);
59 std::string generateResponseToMessage(zmq::message_t& msg, portData& pdata,
CoreType ctype);
61 std::thread mainLoopThread;
62 std::mutex threadGuard;
63 const Json::Value* config_{
nullptr};
64 const std::string name_;
65 bool zmq_enabled_{
false};
66 bool zmqss_enabled_{
false};
67 std::atomic_bool exitAll{
false};
69 std::string mZmqInterface{
"tcp://127.0.0.1"};
Definition: TypedBrokerServer.hpp:24
Definition: zmqBrokerServer.hpp:33
virtual void processArgs(std::string_view args) override
Definition: zmqBrokerServer.cpp:30
virtual void startServer(const Json::Value *val, const std::shared_ptr< TypedBrokerServer > &ptr) override
Definition: zmqBrokerServer.cpp:49
virtual void stopServer() override
Definition: zmqBrokerServer.cpp:65
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
CoreType
Definition: CoreTypes.hpp:46