diff options
Diffstat (limited to 'src/server/ipc')
-rw-r--r-- | src/server/ipc/Commands.cpp | 8 | ||||
-rw-r--r-- | src/server/ipc/Commands.h | 8 | ||||
-rw-r--r-- | src/server/ipc/ZMQTask.h | 4 | ||||
-rw-r--r-- | src/server/ipc/ZmqMux.cpp | 10 | ||||
-rw-r--r-- | src/server/ipc/ZmqMux.h | 2 | ||||
-rw-r--r-- | src/server/ipc/ZmqWorker.cpp | 5 | ||||
-rw-r--r-- | src/server/ipc/ZmqWorker.h | 6 |
7 files changed, 21 insertions, 22 deletions
diff --git a/src/server/ipc/Commands.cpp b/src/server/ipc/Commands.cpp index 8e494fc34b9..61b448d3d01 100644 --- a/src/server/ipc/Commands.cpp +++ b/src/server/ipc/Commands.cpp @@ -49,14 +49,14 @@ zmqpp::message& operator>>(zmqpp::message& msg, Battlenet::ToonHandle& toonHandl return msg; } -zmqpp::message& operator<<(zmqpp::message& msg, IPCHeader& header) +zmqpp::message& operator<<(zmqpp::message& msg, IPCHeader const& header) { msg << header.Channel; msg << header.Command; return msg; } -zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::RealmHandle& realm) +zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::RealmHandle const& realm) { msg << realm.Region; msg << realm.Battlegroup; @@ -64,14 +64,14 @@ zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::RealmHandle& realm) return msg; } -zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::Header& header) +zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::Header const& header) { msg << header.Ipc; msg << header.Realm; return msg; } -zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::ToonHandle& toonHandle) +zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::ToonHandle const& toonHandle) { msg << toonHandle.AccountId; msg << toonHandle.GameAccountId; diff --git a/src/server/ipc/Commands.h b/src/server/ipc/Commands.h index 05309a45022..e34f939bae4 100644 --- a/src/server/ipc/Commands.h +++ b/src/server/ipc/Commands.h @@ -75,9 +75,9 @@ zmqpp::message& operator>>(zmqpp::message& msg, Battlenet::RealmHandle& realm); zmqpp::message& operator>>(zmqpp::message& msg, Battlenet::Header& header); zmqpp::message& operator>>(zmqpp::message& msg, Battlenet::ToonHandle& toonHandle); -zmqpp::message& operator<<(zmqpp::message& msg, IPCHeader& header); -zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::RealmHandle& realm); -zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::Header& header); -zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::ToonHandle& toonHandle); +zmqpp::message& operator<<(zmqpp::message& msg, IPCHeader const& header); +zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::RealmHandle const& realm); +zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::Header const& header); +zmqpp::message& operator<<(zmqpp::message& msg, Battlenet::ToonHandle const& toonHandle); #endif // _COMMANDS_H diff --git a/src/server/ipc/ZMQTask.h b/src/server/ipc/ZMQTask.h index 24251893aaa..1141f740f76 100644 --- a/src/server/ipc/ZMQTask.h +++ b/src/server/ipc/ZMQTask.h @@ -45,8 +45,8 @@ protected: zmqpp::poller* _poller; - zmqpp::socket* _inproc; - std::thread* _thread; + zmqpp::socket* _inproc = nullptr; + std::thread* _thread = nullptr; }; #endif // __ZMQTASK_H diff --git a/src/server/ipc/ZmqMux.cpp b/src/server/ipc/ZmqMux.cpp index 2b62eaaf1eb..0f87106a948 100644 --- a/src/server/ipc/ZmqMux.cpp +++ b/src/server/ipc/ZmqMux.cpp @@ -18,15 +18,15 @@ #include "ZmqMux.h" #include "ZmqContext.h" -ZmqMux::ZmqMux(std::string from_uri, std::string to_uri): - _fromAddress(from_uri) +ZmqMux::ZmqMux(std::string const& fromUri, std::string const& toUri): + _fromAddress(fromUri) { - printf("Opening muxer thread from %s to %s\n", from_uri.c_str(), to_uri.c_str()); + printf("Opening muxer thread from %s to %s\n", fromUri.c_str(), toUri.c_str()); _from = sIpcContext->CreateNewSocket(zmqpp::socket_type::pull); _to = sIpcContext->CreateNewSocket(zmqpp::socket_type::push); - _from->bind(from_uri); - _to->connect(to_uri); + _from->bind(fromUri); + _to->connect(toUri); } ZmqMux::~ZmqMux() diff --git a/src/server/ipc/ZmqMux.h b/src/server/ipc/ZmqMux.h index 07336330253..c6ec26596c1 100644 --- a/src/server/ipc/ZmqMux.h +++ b/src/server/ipc/ZmqMux.h @@ -29,7 +29,7 @@ class ZmqMux : public ZMQTask { public: - ZmqMux(std::string from, std::string to); + ZmqMux(std::string const& from, std::string const& to); ~ZmqMux(); bool Send(zmqpp::message*, bool dont_block = false); void Run() override; diff --git a/src/server/ipc/ZmqWorker.cpp b/src/server/ipc/ZmqWorker.cpp index f205ea831b5..a3db41efe18 100644 --- a/src/server/ipc/ZmqWorker.cpp +++ b/src/server/ipc/ZmqWorker.cpp @@ -18,8 +18,8 @@ #include "ZmqWorker.h" #include "ZmqContext.h" -ZmqWorker::ZmqWorker(std::string task_uri, std::string res_uri) : - _taskUri(task_uri), _resultsUri(res_uri) +ZmqWorker::ZmqWorker(std::string const& taskUri, std::string const& resUri) : + _taskUri(taskUri), _resultsUri(resUri) { } @@ -27,7 +27,6 @@ ZmqWorker::~ZmqWorker() { delete _taskQueue; delete _results; - delete _inproc; } void ZmqWorker::HandleOpen() diff --git a/src/server/ipc/ZmqWorker.h b/src/server/ipc/ZmqWorker.h index b3e221e9129..7f9b0cd1382 100644 --- a/src/server/ipc/ZmqWorker.h +++ b/src/server/ipc/ZmqWorker.h @@ -24,19 +24,19 @@ class ZmqWorker : public ZMQTask { public: - ZmqWorker(std::string task_uri, std::string res_uri); + ZmqWorker(std::string const& taskUri, std::string const& resUri); ~ZmqWorker(); void Run() override; protected: void HandleOpen() override; void HandleClose() override; - zmqpp::socket* _results; + zmqpp::socket* _results = nullptr; private: void PerformWork(); virtual void Dispatch(zmqpp::message const&) = 0; - zmqpp::socket* _taskQueue; + zmqpp::socket* _taskQueue = nullptr; std::string _taskUri; std::string _resultsUri; }; |