Files
src-1.2/external/3rd/library/soePlatform/CTServiceGameAPI/TcpLibrary/TcpHandlers.h
T

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