00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _RECEIVER_H__
00012 #define _RECEIVER_H__
00013
00014
00015 #include <wx/socket.h>
00016
00018
00026 class Receiver
00027 {
00028 private:
00030 wxIPV4address local;
00032 wxIPV4address remote;
00034 wxDatagramSocket * recvSocket;
00036 char * packetBuffer;
00038 unsigned packetMaxLength;
00040 unsigned packetLength;
00041
00042
00043 public:
00045
00050 Receiver(wxString remoteAddr = wxT("127.0.0.1"), unsigned short remotePort = 2627, unsigned short localPort = 2627, unsigned bufferLength = 8192);
00052
00055 ~Receiver();
00057
00061 void UpdateSocket(wxString remoteAddr, unsigned short remotePort, unsigned short localPort);
00063 bool Receive();
00065 unsigned GetPacketLength(){return packetLength;}
00067 char * GetPacket(){return packetBuffer;}
00068
00070
00073 void ResizeBuffer(unsigned short length);
00074 };
00075
00076
00077
00078
00079 #endif