Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
WorldSocketAcceptor.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
10
11#ifndef SF_WORLDSOCKETACCEPTOR_H
12#define SF_WORLDSOCKETACCEPTOR_H
13
14#include "Common.h"
16#include "WorldSocket.h"
17#include <boost/asio/ip/tcp.hpp>
18#include <atomic>
19#include <memory>
20
21class ReactorRunnable;
22
24{
25public:
28
29 bool Open(uint16 port, const char* address);
30 void Close();
31 void Update();
32
33private:
34 void AsyncAccept();
35 void HandleAccept(ReactorRunnable* reactor, WorldSocketHandle socket, boost::asio::ip::tcp::endpoint const& remoteEndpoint,
36 boost::system::error_code const& error);
37
39 boost::asio::ip::tcp::acceptor m_Acceptor;
40 std::atomic<bool> m_Closed;
41};
42
43#endif /* __WORLDSOCKETACCEPTOR_H_ */
std::uint16_t uint16
Definition Define.h:78
bool Open(uint16 port, const char *address)
boost::asio::ip::tcp::acceptor m_Acceptor
Skyfire::Asio::IoContextThreadGroup m_ThreadGroup
std::atomic< bool > m_Closed
void HandleAccept(ReactorRunnable *reactor, WorldSocketHandle socket, boost::asio::ip::tcp::endpoint const &remoteEndpoint, boost::system::error_code const &error)
boost::asio::ip::tcp::socket WorldSocketHandle
Definition WorldSocket.h:31