2025-05-02 22:51:28 +08:00

34 lines
555 B
C++

#ifndef __NNGSERVER_H__
#define __NNGSERVER_H__
#include "Core/Singleton.h"
namespace boost {
namespace asio {
class io_context;
}
} // namespace boost
namespace Nng {
namespace Asio {
class Socket;
}
} // namespace Nng
class NngServer : public std::enable_shared_from_this<NngServer> {
friend class Core::Singleton<NngServer>;
public:
void start(uint16_t replyPort);
protected:
NngServer(boost::asio::io_context &ioContex);
void asyncRead();
private:
std::shared_ptr<Nng::Asio::Socket> m_socket;
};
#endif // __NNGSERVER_H__