SpiecsEngine
 
Loading...
Searching...
No Matches

◆ HttpServer() [1/2]

Spices::Net::HttpServer::HttpServer ( const InetAddress & listenAddress,
int idleSeconds,
TcpServer::Option option = TcpServer::Option::NoReusePort )

Constructor Function.

Parameters
[in]listenAddressServer listen address.
[in]idleSeconds.
[in]optionIs reuse port.

Definition at line 17 of file HttpServer.cpp.

22 : m_Server(listenAddress, option)
23 , m_HttpCallback(nullptr)
24 , m_IdleSeconds(idleSeconds)
25 {
27
28 m_Server.AddConnectionCallback(std::bind(&HttpServer::OnConnection, this, std::placeholders::_1));
29 m_Server.AddMessageCallback(std::bind(&HttpServer::OnMessage, this, std::placeholders::_1, std::placeholders::_2));
30 }
#define SPICES_PROFILE_ZONE
HttpCallback m_HttpCallback
Definition HttpServer.h:75
void OnConnection(const TcpConnectionPtr &connection)
void OnMessage(const TcpConnectionPtr &connection, Buffer *buf)
void AddMessageCallback(const DelegateMessageCallback::Agent &cb)
Add Message Call back.
Definition TcpServer.h:89
void AddConnectionCallback(const DelegateConnectionCallback::Agent &cb)
Add Connection Call back.
Definition TcpServer.h:80

References HttpServer(), and m_IdleSeconds.

Referenced by HttpServer().