![]() |
TrinityCore
|
#include <HttpService.h>
Classes | |
class | Thread |
Public Member Functions | |
HttpService (std::string_view loggerSuffix) | |
bool | StartNetwork (Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int32 threadCount=1) override |
void | StopNetwork () override |
template<HttpRequestHandler< SessionImpl > Callable> | |
void | RegisterHandler (boost::beast::http::verb method, std::string_view path, Callable handler, RequestHandlerFlag flags=RequestHandlerFlag::None) |
virtual std::shared_ptr< SessionState > | CreateNewSessionState (boost::asio::ip::address const &address) |
void | RegisterHandler (boost::beast::http::verb method, std::string_view path, std::function< RequestHandlerResult(std::shared_ptr< AbstractSocket > session, RequestContext &context)> handler, RequestHandlerFlag flags=RequestHandlerFlag::None) |
![]() | |
virtual | ~SocketMgr () |
virtual bool | StartNetwork (Trinity::Asio::IoContext &ioContext, std::string const &bindIp, uint16 port, int threadCount) |
virtual void | StopNetwork () |
void | Wait () |
virtual void | OnSocketOpen (boost::asio::ip::tcp::socket &&sock, uint32 threadIndex) |
int32 | GetNetworkThreadCount () const |
uint32 | SelectThreadWithMinConnections () const |
std::pair< boost::asio::ip::tcp::socket *, uint32 > | GetSocketForAccept () |
![]() | |
DispatcherService (std::string_view loggerSuffix) | |
RequestHandlerResult | HandleRequest (std::shared_ptr< AbstractSocket > session, RequestContext &context) |
![]() | |
SessionService (std::string_view loggerSuffix) | |
void | Start (Asio::IoContext &ioContext) |
void | Stop () |
std::shared_ptr< SessionState > | FindAndRefreshSessionState (std::string_view id, boost::asio::ip::address const &address) |
void | MarkSessionInactive (boost::uuids::uuid const &id) |
Protected Member Functions | |
NetworkThread< SessionImpl > * | CreateThreads () const override |
![]() | |
SocketMgr () | |
virtual NetworkThread< SessionImpl > * | CreateThreads () const=0 |
![]() | |
void | RegisterHandler (boost::beast::http::verb method, std::string_view path, std::function< RequestHandlerResult(std::shared_ptr< AbstractSocket > session, RequestContext &context)> handler, RequestHandlerFlag flags=RequestHandlerFlag::None) |
![]() | |
void | InitAndStoreSessionState (std::shared_ptr< SessionState > state, boost::asio::ip::address const &address) |
void | KillInactiveSessions () |
Protected Attributes | |
Asio::IoContext * | _ioContext |
std::string | _logger |
![]() | |
AsyncAcceptor * | _acceptor |
NetworkThread< SessionImpl > * | _threads |
int32 | _threadCount |
Additional Inherited Members | |
![]() | |
static RequestHandlerResult | HandleBadRequest (std::shared_ptr< AbstractSocket > session, RequestContext &context) |
static RequestHandlerResult | HandleUnauthorized (std::shared_ptr< AbstractSocket > session, RequestContext &context) |
static RequestHandlerResult | HandlePathNotFound (std::shared_ptr< AbstractSocket > session, RequestContext &context) |
Definition at line 116 of file HttpService.h.
|
inline |
Definition at line 119 of file HttpService.h.
|
inlinevirtual |
Reimplemented in Battlenet::LoginRESTService.
Definition at line 152 of file HttpService.h.
|
inlineoverrideprotectedvirtual |
Implements SocketMgr< SessionImpl >.
Definition at line 175 of file HttpService.h.
|
inline |
void Trinity::Net::Http::DispatcherService::RegisterHandler | ( | boost::beast::http::verb | method, |
std::string_view | path, | ||
std::function< RequestHandlerResult(std::shared_ptr< AbstractSocket > session, RequestContext &context)> | handler, | ||
RequestHandlerFlag | flags = RequestHandlerFlag::None |
||
) |
Definition at line 69 of file HttpService.cpp.
|
inlineoverride |
|
inlineoverridevirtual |
Reimplemented from SocketMgr< SessionImpl >.
Definition at line 133 of file HttpService.h.
|
protected |
Definition at line 183 of file HttpService.h.
|
protected |
Definition at line 184 of file HttpService.h.