Fixed sender again, as it did not work when sending errors.

This commit is contained in:
lotodore
2007-10-28 15:06:57 +00:00
parent e951bda1db
commit cdea81b2ba
12 changed files with 104 additions and 148 deletions
+8 -8
View File
@@ -41,25 +41,25 @@ public:
SenderThread(SenderCallback &cb);
virtual ~SenderThread();
void Send(SessionId session, boost::shared_ptr<NetPacket> packet);
void Send(SessionId session, const NetPacketList &packetList);
void Send(boost::shared_ptr<SessionData> session, boost::shared_ptr<NetPacket> packet);
void Send(boost::shared_ptr<SessionData> session, const NetPacketList &packetList);
void SendLowPrio(SessionId session, boost::shared_ptr<NetPacket> packet);
void SendLowPrio(SessionId session, const NetPacketList &packetList);
void SendLowPrio(boost::shared_ptr<SessionData> session, boost::shared_ptr<NetPacket> packet);
void SendLowPrio(boost::shared_ptr<SessionData> session, const NetPacketList &packetList);
protected:
typedef std::pair<boost::shared_ptr<NetPacket>, SessionId> SendData;
typedef std::pair<boost::shared_ptr<NetPacket>, boost::shared_ptr<SessionData> > SendData;
typedef std::deque<SendData> SendDataDeque;
// Main function of the thread.
virtual void Main();
void InternalStore(SendDataDeque &sendQueue, unsigned maxQueueSize, SessionId session, boost::shared_ptr<NetPacket> packet);
void InternalStore(SendDataDeque &sendQueue, unsigned maxQueueSize, SessionId session, const NetPacketList &packetList);
void InternalStore(SendDataDeque &sendQueue, unsigned maxQueueSize, boost::shared_ptr<SessionData> session, boost::shared_ptr<NetPacket> packet);
void InternalStore(SendDataDeque &sendQueue, unsigned maxQueueSize, boost::shared_ptr<SessionData> session, const NetPacketList &packetList);
private:
SessionId m_curSession;
boost::shared_ptr<SessionData> m_curSession;
std::deque<SendData> m_outBuf;
mutable boost::mutex m_outBufMutex;