mirror of
https://github.com/edubart/otclient.git
synced 2025-04-29 17:19:20 +02:00
Fix an issue with Connection class linkage
This commit is contained in:
parent
1ab18788e6
commit
80b35b8308
@ -101,7 +101,7 @@ void Connection::connect(const std::string& host, uint16 port, const std::functi
|
||||
m_resolver.async_resolve(query, std::bind(&Connection::onResolve, asConnection(), std::placeholders::_1, std::placeholders::_2));
|
||||
|
||||
m_readTimer.cancel();
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(READ_TIMEOUT));
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(static_cast<uint32>(READ_TIMEOUT)));
|
||||
m_readTimer.async_wait(std::bind(&Connection::onTimeout, asConnection(), std::placeholders::_1));
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ void Connection::internal_connect(asio::ip::basic_resolver<asio::ip::tcp>::itera
|
||||
m_socket.async_connect(*endpointIterator, std::bind(&Connection::onConnect, asConnection(), std::placeholders::_1));
|
||||
|
||||
m_readTimer.cancel();
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(READ_TIMEOUT));
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(static_cast<uint32>(READ_TIMEOUT)));
|
||||
m_readTimer.async_wait(std::bind(&Connection::onTimeout, asConnection(), std::placeholders::_1));
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ void Connection::internal_write()
|
||||
std::bind(&Connection::onWrite, asConnection(), std::placeholders::_1, std::placeholders::_2, outputStream));
|
||||
|
||||
m_writeTimer.cancel();
|
||||
m_writeTimer.expires_from_now(boost::posix_time::seconds(WRITE_TIMEOUT));
|
||||
m_writeTimer.expires_from_now(boost::posix_time::seconds(static_cast<uint32>(WRITE_TIMEOUT)));
|
||||
m_writeTimer.async_wait(std::bind(&Connection::onTimeout, asConnection(), std::placeholders::_1));
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ void Connection::read(uint16 bytes, const RecvCallback& callback)
|
||||
std::bind(&Connection::onRecv, asConnection(), std::placeholders::_1, std::placeholders::_2));
|
||||
|
||||
m_readTimer.cancel();
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(READ_TIMEOUT));
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(static_cast<uint32>(READ_TIMEOUT)));
|
||||
m_readTimer.async_wait(std::bind(&Connection::onTimeout, asConnection(), std::placeholders::_1));
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ void Connection::read_until(const std::string& what, const RecvCallback& callbac
|
||||
std::bind(&Connection::onRecv, asConnection(), std::placeholders::_1, std::placeholders::_2));
|
||||
|
||||
m_readTimer.cancel();
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(READ_TIMEOUT));
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(static_cast<uint32>(READ_TIMEOUT)));
|
||||
m_readTimer.async_wait(std::bind(&Connection::onTimeout, asConnection(), std::placeholders::_1));
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ void Connection::read_some(const RecvCallback& callback)
|
||||
std::bind(&Connection::onRecv, asConnection(), std::placeholders::_1, std::placeholders::_2));
|
||||
|
||||
m_readTimer.cancel();
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(READ_TIMEOUT));
|
||||
m_readTimer.expires_from_now(boost::posix_time::seconds(static_cast<uint32>(READ_TIMEOUT)));
|
||||
m_readTimer.async_wait(std::bind(&Connection::onTimeout, asConnection(), std::placeholders::_1));
|
||||
}
|
||||
|
||||
|
@ -33,10 +33,9 @@ class Connection : public LuaObject
|
||||
typedef std::function<void(const boost::system::error_code&)> ErrorCallback;
|
||||
typedef std::function<void(uint8*, uint16)> RecvCallback;
|
||||
|
||||
static constexpr int32_t READ_TIMEOUT = 30;
|
||||
static constexpr int32_t WRITE_TIMEOUT = 30;
|
||||
|
||||
enum {
|
||||
READ_TIMEOUT = 30,
|
||||
WRITE_TIMEOUT = 30,
|
||||
SEND_BUFFER_SIZE = 65536,
|
||||
RECV_BUFFER_SIZE = 65536
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user