Shadowrun: Awakened 29 September 2011 - Build 871
SendToThread.h
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 namespace RakNet
00014 {
00015 class SendToThread
00016 {
00017 public:
00018     SendToThread();
00019     ~SendToThread();
00020 
00021     struct SendToThreadBlock
00022     {
00023         SOCKET s;
00024         SystemAddress systemAddress;
00025         unsigned short remotePortRakNetWasStartedOn_PS3;
00026         unsigned int extraSocketOptions;
00027         char data[MAXIMUM_MTU_SIZE];
00028         unsigned short dataWriteOffset;
00029     };
00030 
00031     static SendToThreadBlock* AllocateBlock(void);
00032     static void ProcessBlock(SendToThreadBlock* threadedSend);
00033 
00034     static void AddRef(void);
00035     static void Deref(void);
00036     static DataStructures::ThreadsafeAllocatingQueue<SendToThreadBlock> objectQueue;
00037 protected:
00038     static int refCount;
00039     static ThreadPool<SendToThreadBlock*,SendToThreadBlock*> threadPool;
00040 
00041 };
00042 }
00043 
00044 
00045 #endif
00046 
00047 #endif

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net