mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-28 23:16:15 -04:00
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#ifndef TCPHANDLERS_H
|
|
#define TCPHANDLERS_H
|
|
|
|
#ifdef EXTERNAL_DISTRO
|
|
namespace NAMESPACE
|
|
{
|
|
#endif
|
|
|
|
class TcpConnection;
|
|
|
|
/**
|
|
* @brief Interface used by TcpManager class for notification to application of connection state/etc.
|
|
*
|
|
* Note: these callbacks will only be made when during a call to TcpManager::giveTime.
|
|
*/
|
|
class TcpManagerHandler
|
|
{
|
|
public:
|
|
/**
|
|
* @brief Callback made when a new connection has been established by the manager.
|
|
*/
|
|
virtual void OnConnectRequest(TcpConnection *con)=0;
|
|
|
|
};
|
|
|
|
/**
|
|
* @brief Interface used by TcpConnection class for notification to application of connection state/etc.
|
|
*
|
|
* Note: these callbacks will only be made when during a call to TcpManager::giveTime.
|
|
*/
|
|
class TcpConnectionHandler
|
|
{
|
|
public:
|
|
/**
|
|
* @brief Callback made when a new message has been received on the specified connection.
|
|
*/
|
|
virtual void OnRoutePacket(TcpConnection *con, const unsigned char *data, int dataLen)=0;
|
|
|
|
/**
|
|
* @brief Callback made when the specified connection has closed, or been closed.
|
|
*/
|
|
virtual void OnTerminated(TcpConnection *con)=0;
|
|
};
|
|
|
|
|
|
#ifdef EXTERNAL_DISTRO
|
|
};
|
|
#endif
|
|
#endif //TCPHANDLERS_H
|
|
|