Use several sender threads with load balancing for sending the avatars. Remember last failed send operation (not yet a list, just the last) and cancel any more low prio sends to that sender.

This commit is contained in:
lotodore
2007-11-14 22:11:04 +00:00
parent 5328bf082f
commit 82a1be763b
4 changed files with 57 additions and 24 deletions
+4
View File
@@ -43,6 +43,9 @@ public:
void SendLowPrio(boost::shared_ptr<SessionData> session, boost::shared_ptr<NetPacket> packet);
void SendLowPrio(boost::shared_ptr<SessionData> session, const NetPacketList &packetList);
unsigned GetNumPacketsInQueue() const;
bool operator<(const SenderThread &other) const;
protected:
typedef std::pair<boost::shared_ptr<NetPacket>, boost::shared_ptr<SessionData> > SendData;
typedef std::deque<SendData> SendDataDeque;
@@ -68,6 +71,7 @@ private:
char m_tmpOutBuf[MAX_PACKET_SIZE];
unsigned m_tmpOutBufSize;
bool m_tmpIsLowPrio;
unsigned m_lastInvalidSessionId;
SenderCallback &m_callback;
};