ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::io::rpc::ZMQReceiver Class Reference

Class for the server side receiving requests from a client. More...

#include <ZMQReceiver.h>

Inheritance diagram for cloudViewer::io::rpc::ZMQReceiver:

Public Member Functions

 ZMQReceiver (const std::string &address="tcp://127.0.0.1:51454", int timeout=10000)
 
 ZMQReceiver (const ZMQReceiver &)=delete
 
ZMQReceiveroperator= (const ZMQReceiver &)=delete
 
virtual ~ZMQReceiver ()
 
void Start ()
 Starts the receiver mainloop in a new thread. More...
 
void Stop ()
 
std::runtime_error GetLastError ()
 Returns the last error from the mainloop thread. More...
 
void SetMessageProcessor (std::shared_ptr< MessageProcessorBase > processor)
 Sets the message processor object which will process incoming messages. More...
 

Detailed Description

Class for the server side receiving requests from a client.

Definition at line 39 of file ZMQReceiver.h.

Constructor & Destructor Documentation

◆ ZMQReceiver() [1/2]

cloudViewer::io::rpc::ZMQReceiver::ZMQReceiver ( const std::string &  address = "tcp://127.0.0.1:51454",
int  timeout = 10000 
)

Constructs a receiver listening on the specified address.

Parameters
addressAddress to listen on.
timeoutTimeout in milliseconds for sending the reply.

Definition at line 35 of file ZMQReceiver.cpp.

◆ ZMQReceiver() [2/2]

cloudViewer::io::rpc::ZMQReceiver::ZMQReceiver ( const ZMQReceiver )
delete

◆ ~ZMQReceiver()

cloudViewer::io::rpc::ZMQReceiver::~ZMQReceiver ( )
virtual

Definition at line 43 of file ZMQReceiver.cpp.

References Stop().

Member Function Documentation

◆ GetLastError()

std::runtime_error cloudViewer::io::rpc::ZMQReceiver::GetLastError ( )

Returns the last error from the mainloop thread.

Definition at line 86 of file ZMQReceiver.cpp.

References result.

Referenced by Start().

◆ operator=()

ZMQReceiver& cloudViewer::io::rpc::ZMQReceiver::operator= ( const ZMQReceiver )
delete

◆ SetMessageProcessor()

void cloudViewer::io::rpc::ZMQReceiver::SetMessageProcessor ( std::shared_ptr< MessageProcessorBase processor)

Sets the message processor object which will process incoming messages.

Definition at line 212 of file ZMQReceiver.cpp.

Referenced by cloudViewer::io::rpc::DummyReceiver::DummyReceiver().

◆ Start()

void cloudViewer::io::rpc::ZMQReceiver::Start ( )

Starts the receiver mainloop in a new thread.

Definition at line 45 of file ZMQReceiver.cpp.

References GetLastError(), LogDebug, and LogError.

Referenced by cloudViewer::io::pybind_rpc().

◆ Stop()

void cloudViewer::io::rpc::ZMQReceiver::Stop ( )

Stops the receiver mainloop and joins the thread. This function blocks until the mainloop is done with processing messages that have already been received.

Definition at line 69 of file ZMQReceiver.cpp.

References LogDebug.

Referenced by cloudViewer::io::pybind_rpc(), and ~ZMQReceiver().


The documentation for this class was generated from the following files: