mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-11-27 16:30:44 +00:00
270ee9a0bc
* Adds TCPInterface ctor * Adds `TCPInterface::Receive()` * Adds `TCPInterface::HasLostConnection()`
32 lines
643 B
C++
32 lines
643 B
C++
// TODO: Implement TCPInterface.h
|
|
|
|
#ifndef __SIMPLE_TCP_SERVER
|
|
#define __SIMPLE_TCP_SERVER
|
|
|
|
#include "NetworkTypes.h"
|
|
#include "SingleProducerConsumer.h"
|
|
#include "Export.h"
|
|
|
|
/// \internal
|
|
/// \brief As the name says, a simple multithreaded TCP server. Used by TelnetTransport
|
|
class RAK_DLL_EXPORT TCPInterface
|
|
{
|
|
public:
|
|
TCPInterface();
|
|
|
|
/// Returns data received
|
|
Packet* Receive( void );
|
|
|
|
/// Queued events of lost connections
|
|
PlayerID HasLostConnection(void);
|
|
|
|
protected:
|
|
bool isStarted;
|
|
|
|
DataStructures::SingleProducerConsumer<Packet> incomingMessages;
|
|
|
|
DataStructures::SingleProducerConsumer<PlayerID> lostConnections;
|
|
};
|
|
|
|
#endif
|