many changes and refactoring

This commit is contained in:
Eduardo Bart
2011-07-13 18:12:36 -03:00
parent 6c05ee0e82
commit 8ef1b28546
120 changed files with 1545 additions and 1273 deletions

View File

@@ -25,10 +25,13 @@
#ifndef CONNECTION_H
#define CONNECTION_H
#include <global.h>
#include <net/inputmessage.h>
#include <net/outputmessage.h>
#include <prerequisites.h>
#include <boost/asio.hpp>
#include <boost/function.hpp>
typedef boost::function<void(boost::system::error_code&)> ErrorCallback;
typedef boost::function<void(InputMessage*)> RecvCallback;
@@ -40,7 +43,7 @@ public:
static void poll();
void connect(const std::string& host, uint16 port, const SimpleCallback& connectCallback);
void connect(const std::string& host, uint16 port, const boost::function<void()>& connectCallback);
void send(OutputMessage *outputMessage);
void setErrorCallback(const ErrorCallback& errorCallback) { m_errorCallback = errorCallback; }
@@ -63,7 +66,7 @@ public:
private:
ErrorCallback m_errorCallback;
RecvCallback m_recvCallback;
SimpleCallback m_connectCallback;
boost::function<void()> m_connectCallback;
ConnectionState_t m_connectionState;
boost::asio::deadline_timer m_timer;