SpiecsEngine
 
Loading...
Searching...
No Matches

◆ TcpServerTest()

SpicesTest::TcpServerTest::TcpServerTest ( const Spices::Net::InetAddress & addr)
inline

Definition at line 19 of file TcpServer_test.h.

20 : m_Server(addr)
21 {
22 m_Server.AddConnectionCallback([=](const Spices::Net::TcpConnectionPtr& connection) { onConnection(connection); });
23 m_Server.AddMessageCallback([=](const Spices::Net::TcpConnectionPtr& connection, Spices::Net::Buffer* buf) { onMessage(connection, buf); });
24 }
void onConnection(const Spices::Net::TcpConnectionPtr &connection)
Spices::Net::TcpServer m_Server
void onMessage(const Spices::Net::TcpConnectionPtr &connection, Spices::Net::Buffer *buf)
Wrapper of readwrite buffer.
Definition Buffer.h:19
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
std::shared_ptr< TcpConnection > TcpConnectionPtr
Definition Callbacks.h:18

References TcpServerTest().

Referenced by TcpServerTest(), and SpicesTest::TEST().