CppServer  1.0.0.0
C++ Server Library
push_client.h
Go to the documentation of this file.
1 
9 #ifndef CPPSERVER_NANOMSG_PUSH_CLIENT_H
10 #define CPPSERVER_NANOMSG_PUSH_CLIENT_H
11 
12 #include "client.h"
13 
14 namespace CppServer {
15 namespace Nanomsg {
16 
18 
26 class PushClient : public Client
27 {
28 public:
30 
33  explicit PushClient(const std::string& address)
34  : Client(CppServer::Nanomsg::Domain::Std, CppServer::Nanomsg::Protocol::Push, address, false)
35  {}
36  PushClient(const PushClient&) = delete;
37  PushClient(PushClient&&) = default;
38  virtual ~PushClient() = default;
39 
40  PushClient& operator=(const PushClient&) = delete;
41  PushClient& operator=(PushClient&&) = default;
42 
43 private:
44  using Client::Receive;
45  using Client::TryReceive;
48  using Client::onIdle;
49  using Client::onReceived;
50 };
51 
54 } // namespace Nanomsg
55 } // namespace CppServer
56 
57 #endif // CPPSERVER_NANOMSG_PUSH_CLIENT_H
PushClient(const std::string &address)
Initialize client with a given endpoint address.
Definition: push_client.h:33
size_t Receive(Message &message)
Receive a message from the server.
Definition: client.cpp:189
This socket is used to send messages to a cluster of load-balanced nodes. Receive operation is not im...
Nanomsg push client.
Definition: push_client.h:26
C++ Server project definitions.
Definition: asio.h:24
virtual void onIdle()
Handle client idle notification.
Definition: client.h:141
virtual ~PushClient()=default
size_t TryReceive(Message &message)
Try to receive a message from the server in non-blocking mode.
Definition: client.cpp:211
PushClient & operator=(const PushClient &)=delete
Protocol
Nanomsg protocol.
Definition: nanomsg.h:56
Nanomsg client.
Definition: client.h:29
Domain
Nanomsg domain.
Definition: nanomsg.h:41
Nanomsg client definition.
virtual void onReceived(Message &message)
Handle message received notification.
Definition: client.h:147
virtual void onThreadInitialize()
Initialize thread handler.
Definition: client.h:128
Standard full-blown socket.
virtual void onThreadCleanup()
Cleanup thread handler.
Definition: client.h:133