Added helper class for receiving data. Modified sender thread to support sending partial packets. Prepared abstractions for server state machine.

This commit is contained in:
lotodore
2007-03-13 02:23:12 +00:00
parent 29b29ec42e
commit f5289a6fcf
24 changed files with 508 additions and 70 deletions
+7
View File
@@ -24,6 +24,10 @@
#include <string>
#include <net/socket_helper.h>
#define MAX_PACKET_SIZE 256
#define NET_TYPE_TEST 0
#ifdef _MSC_VER
#pragma pack(push, 2)
#else
@@ -54,16 +58,19 @@ class NetPacket
public:
virtual ~NetPacket();
virtual void SetData(const NetPacketHeader *p) = 0;
virtual NetPacketHeader *GetData() = 0;
};
class TestNetPacket : public NetPacket
{
public:
TestNetPacket();
TestNetPacket(u_int32_t value);
virtual ~TestNetPacket();
virtual NetPacketHeader *GetData();
virtual void SetData(const NetPacketHeader *p);
protected:
NetPacketInit m_data;