Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
RealmAcceptor.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SF_REALMACCEPTOR_H
7#define SF_REALMACCEPTOR_H
8
9#include "Common.h"
10#include "RealmSocket.h"
12#include <boost/asio/ip/tcp.hpp>
13#include <atomic>
14#include <string>
15
17{
18public:
21
22 bool Open(uint16 port, std::string const& bindIp);
23 void Close();
24 void Update();
25
26private:
27 void AsyncAccept();
28 void HandleAccept(std::shared_ptr<RealmSocketHandle> clientSocket, boost::system::error_code const& error);
29
31 boost::asio::ip::tcp::acceptor _acceptor;
32 std::atomic<bool> _closed;
33};
34
35#endif
std::uint16_t uint16
Definition Define.h:78
void HandleAccept(std::shared_ptr< RealmSocketHandle > clientSocket, boost::system::error_code const &error)
Skyfire::Asio::IoContextThreadGroup _threadGroup
bool Open(uint16 port, std::string const &bindIp)
boost::asio::ip::tcp::acceptor _acceptor
std::atomic< bool > _closed