Go to the documentation of this file.00001 #ifndef __SENDTO_THREAD
00002 #define __SENDTO_THREAD
00003
00004 #include "RakNetDefines.h"
00005
00006 #ifdef USE_THREADED_SEND
00007
00008 #include "InternalPacket.h"
00009 #include "SocketLayer.h"
00010 #include "DS_ThreadsafeAllocatingQueue.h"
00011 #include "ThreadPool.h"
00012
00013 class SendToThread
00014 {
00015 public:
00016 SendToThread();
00017 ~SendToThread();
00018
00019 struct SendToThreadBlock
00020 {
00021 SOCKET s;
00022 unsigned int binaryAddress;
00023 unsigned short port;
00024 unsigned short remotePortRakNetWasStartedOn_PS3;
00025 char data[MAXIMUM_MTU_SIZE];
00026 unsigned short dataWriteOffset;
00027 };
00028
00029 static SendToThreadBlock* AllocateBlock(void);
00030 static void ProcessBlock(SendToThreadBlock* threadedSend);
00031
00032 static void AddRef(void);
00033 static void Deref(void);
00034 static DataStructures::ThreadsafeAllocatingQueue<SendToThreadBlock> objectQueue;
00035 protected:
00036 static int refCount;
00037 static ThreadPool<SendToThreadBlock*,SendToThreadBlock*> threadPool;
00038
00039 };
00040
00041 #endif
00042
00043 #endif