[raknet] Add TCPInterface class

* Adds TCPInterface ctor
* Adds `TCPInterface::Receive()`
* Adds `TCPInterface::HasLostConnection()`
This commit is contained in:
RD42
2024-02-13 23:22:42 +08:00
parent df9176c717
commit 270ee9a0bc
3 changed files with 78 additions and 0 deletions

31
raknet/TCPInterface.h Normal file
View File

@ -0,0 +1,31 @@
// 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