/EQEmuServer/common/EmuTCPServer.h
C Header | 38 lines | 24 code | 10 blank | 4 comment | 0 complexity | 1f9c987a9629d9894484c9f52643d9a5 MD5 | raw file
Possible License(s): GPL-2.0
- #ifndef EmuTCPSERVER_H_
- #define EmuTCPSERVER_H_
-
- #include "TCPServer.h"
-
- class EmuTCPConnection;
- struct EmuTCPNetPacket_Struct;
- class ServerPacket;
-
- class EmuTCPServer : public TCPServer<EmuTCPConnection> {
- public:
- EmuTCPServer(uint16 iPort = 0, bool iOldFormat = false);
- virtual ~EmuTCPServer();
-
- //packet broadcast routines.
- void SendPacket(ServerPacket* pack);
- void SendPacket(EmuTCPNetPacket_Struct** tnps);
-
- //special crap for relay management
- EmuTCPConnection *FindConnection(uint32 iID);
-
- //exposed for some crap we pull. Do not call from outside this object.
- TCPServer<EmuTCPConnection>::AddConnection;
-
- protected:
- virtual void Process();
-
- virtual void CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP, uint16 irPort);
-
- bool pOldFormat;
-
- //broadcast packet queue..
- void CheckInQueue();
- Mutex MInQueue;
- EmuTCPNetPacket_Struct* InQueuePop(); //returns ownership
- std::queue<EmuTCPNetPacket_Struct *> m_InQueue;
- };
- #endif /*EmuTCPSERVER_H_*/