// TcpServer.h // Copyright 2000-02, Sony Online Entertainment Inc., all rights reserved. // Author: Justin Randall #ifndef _INCLUDED_TcpServer_H #define _INCLUDED_TcpServer_H //----------------------------------------------------------------------- #include "Address.h" #include #include #include #include //----------------------------------------------------------------------- class Service; class TcpClient; //----------------------------------------------------------------------- class TcpServer { public: TcpServer(Service * service, const std::string & bindAddress, const uint16_t bindPort); ~TcpServer(); const std::string & getBindAddress () const; const uint16_t getBindPort () const; void onConnectionClosed (TcpClient *); void removeClient (TcpClient *); void update (); private: TcpServer & operator = (const TcpServer & rhs); TcpServer(const TcpServer & source); private: Address m_bindAddress; int m_handle; Service * m_service; std::map m_connections; std::vector m_connectionSockets; unsigned char * m_inputBuffer; int m_inputBufferSize; std::set m_pendingDestroys; }; //----------------------------------------------------------------------- #endif // _INCLUDED_TcpServer_H