CppServer
1.0.0.0
C++ Server Library
|
Nanomsg survey client. More...
#include <survey_client.h>
Public Member Functions | |
SurveyClient (const std::string &address, bool threading=true) | |
Initialize client with a given endpoint address. More... | |
SurveyClient (const SurveyClient &)=delete | |
SurveyClient (SurveyClient &&)=default | |
virtual | ~SurveyClient ()=default |
SurveyClient & | operator= (const SurveyClient &)=delete |
SurveyClient & | operator= (SurveyClient &&)=default |
![]() | |
Client (Domain domain, Protocol protocol, const std::string &address, bool threading=true) | |
Initialize client with a given domain, protocol and endpoint address. More... | |
Client (const Client &)=delete | |
Client (Client &&)=default | |
virtual | ~Client () |
Client & | operator= (const Client &)=delete |
Client & | operator= (Client &&)=default |
Socket & | socket () noexcept |
Get the Nanomsg socket. More... | |
bool | IsConnected () const noexcept |
Is the client connected? More... | |
bool | Connect () |
Connect the client. More... | |
bool | Disconnect () |
Disconnect the client. More... | |
bool | Reconnect () |
Reconnect the client. More... | |
size_t | Send (const void *buffer, size_t size) |
Send data to the server. More... | |
size_t | Send (const std::string &text) |
Send a text string to the server. More... | |
size_t | Send (const Message &message) |
Send a message to the server. More... | |
size_t | TrySend (const void *buffer, size_t size) |
Try to send data to the server in non-blocking mode. More... | |
size_t | TrySend (const std::string &text) |
Try to send a text string to the server in non-blocking mode. More... | |
size_t | TrySend (const Message &message) |
Try to send a message to the server in non-blocking mode. More... | |
size_t | Receive (Message &message) |
Receive a message from the server. More... | |
size_t | TryReceive (Message &message) |
Try to receive a message from the server in non-blocking mode. More... | |
Additional Inherited Members | |
![]() | |
virtual void | onThreadInitialize () |
Initialize thread handler. More... | |
virtual void | onThreadCleanup () |
Cleanup thread handler. More... | |
virtual void | onConnected () |
Handle client connected notification. More... | |
virtual void | onDisconnected () |
Handle client disconnected notification. More... | |
virtual void | onIdle () |
Handle client idle notification. More... | |
virtual void | onReceived (Message &message) |
Handle message received notification. More... | |
virtual void | onError (int error, const std::string &message) |
Handle error notification. More... | |
Nanomsg survey client.
Nanomsg survey client is used to response for survey messges from the Nanomsg survey server.
Use to respond to the survey. Survey is received using receive function, response is sent using send function. This socket can be connected to at most one peer.
Thread-safe.
Definition at line 28 of file survey_client.h.
|
inlineexplicit |
Initialize client with a given endpoint address.
address | - Endpoint address |
threading | - Run the client in a separate thread (default is true) |
Definition at line 36 of file survey_client.h.
|
delete |
|
default |
|
virtualdefault |
|
delete |
|
default |