38 lines
688 B
C++
38 lines
688 B
C++
#ifndef __NNGCLIENT_H__
|
|
#define __NNGCLIENT_H__
|
|
|
|
#include "Core/Singleton.h"
|
|
#include <string>
|
|
|
|
namespace boost {
|
|
namespace asio {
|
|
class io_context;
|
|
}
|
|
} // namespace boost
|
|
|
|
namespace Nng {
|
|
|
|
namespace Asio {
|
|
|
|
class Socket;
|
|
}
|
|
} // namespace Nng
|
|
|
|
class NngClient : public std::enable_shared_from_this<NngClient> {
|
|
friend class Core::Singleton<NngClient>;
|
|
|
|
public:
|
|
void start(const std::string &server, uint16_t port);
|
|
void requestZeroCheck();
|
|
void requestZoom(bool in);
|
|
void requestFocus(bool far);
|
|
|
|
protected:
|
|
NngClient(boost::asio::io_context &ioContex);
|
|
void asyncRead();
|
|
|
|
private:
|
|
std::shared_ptr<Nng::Asio::Socket> m_socket;
|
|
};
|
|
|
|
#endif // __NNGCLIENT_H__
|