Fixed one thread per session implementation. Kind of. Still seems to have a handle leak on Windows. However, it does not scale at all and needs to be reverted. It won't even handle 500 players with 500 games on a dual core high end machine.

This commit is contained in:
lotodore
2009-01-11 20:12:26 +00:00
parent 4f7cf0bdb2
commit 29061b661c
11 changed files with 155 additions and 34 deletions
+4 -3
View File
@@ -23,13 +23,13 @@
#include <core/thread.h>
#include <net/senderinterface.h>
#include <net/sessiondata.h>
#include <net/netpacket.h>
#include <net/sendercallback.h>
#include <list>
#include <boost/shared_ptr.hpp>
class SessionData;
#define SENDER_THREAD_TERMINATE_TIMEOUT THREAD_WAIT_INFINITE
class SenderThread : public Thread, public SenderInterface
@@ -56,8 +56,9 @@ private:
SendDataList m_sendQueue;
mutable boost::mutex m_sendQueueMutex;
boost::shared_ptr<SessionData> m_session;
mutable boost::mutex m_sessionMutex;
mutable boost::mutex m_sessionDataMutex;
SOCKET m_sessionSocket;
unsigned m_sessionId;
boost::shared_ptr<NetPacket> m_curPacket;
unsigned m_bytesSent;
SenderCallback &m_callback;