Rewriting sender yet again to fit the new asio design. Polling for new send data is no longer needed, this also reduces lag.

This commit is contained in:
lotodore
2009-06-07 08:51:43 +00:00
parent 9e50969bdc
commit 5f3369432a
14 changed files with 187 additions and 269 deletions
+1 -6
View File
@@ -36,15 +36,12 @@ typedef unsigned SessionId;
#define SESSION_ID_INIT INVALID_SESSION
#define SESSION_ID_GENERIC 0xFFFFFFFF
class SenderInterface;
class SessionData
{
public:
enum State { Init, ReceivingAvatar, Established, Game };
SessionData(boost::shared_ptr<boost::asio::ip::tcp::socket> sock, SessionId id,
boost::shared_ptr<SenderInterface> sender, SessionDataCallback &cb);
SessionData(boost::shared_ptr<boost::asio::ip::tcp::socket> sock, SessionId id, SessionDataCallback &cb);
~SessionData();
SessionId GetId() const;
@@ -69,7 +66,6 @@ public:
void SetClientAddr(const std::string &addr);
ReceiveBuffer &GetReceiveBuffer();
SenderInterface &GetSender();
void ResetActivityTimer();
unsigned GetActivityTimerElapsedSec() const;
@@ -92,7 +88,6 @@ private:
boost::timers::portable::microsec_timer m_activityTimer;
bool m_activityTimeoutNoticeSent;
boost::timers::portable::microsec_timer m_autoDisconnectTimer;
boost::shared_ptr<SenderInterface> m_sender;
SessionDataCallback &m_callback;
unsigned m_maxNumPlayers;