Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
marksamman committed May 24, 2018
1 parent 1dbf440 commit 7193a67
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*.suo
*.user
*.sln.docstates
.vscode/

# Build results

Expand Down
8 changes: 4 additions & 4 deletions src/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void Connection::accept()
{
std::lock_guard<std::recursive_mutex> lockClass(connectionLock);
try {
readTimer.expires_from_now(boost::posix_time::seconds(Connection::read_timeout));
readTimer.expires_from_now(boost::posix_time::seconds(CONNECTION_READ_TIMEOUT));
readTimer.async_wait(std::bind(&Connection::handleTimeout, std::weak_ptr<Connection>(shared_from_this()), std::placeholders::_1));

// Read size of the first packet
Expand Down Expand Up @@ -160,7 +160,7 @@ void Connection::parseHeader(const boost::system::error_code& error)
}

try {
readTimer.expires_from_now(boost::posix_time::seconds(Connection::read_timeout));
readTimer.expires_from_now(boost::posix_time::seconds(CONNECTION_READ_TIMEOUT));
readTimer.async_wait(std::bind(&Connection::handleTimeout, std::weak_ptr<Connection>(shared_from_this()),
std::placeholders::_1));

Expand Down Expand Up @@ -222,7 +222,7 @@ void Connection::parsePacket(const boost::system::error_code& error)
}

try {
readTimer.expires_from_now(boost::posix_time::seconds(Connection::read_timeout));
readTimer.expires_from_now(boost::posix_time::seconds(CONNECTION_READ_TIMEOUT));
readTimer.async_wait(std::bind(&Connection::handleTimeout, std::weak_ptr<Connection>(shared_from_this()),
std::placeholders::_1));

Expand Down Expand Up @@ -254,7 +254,7 @@ void Connection::internalSend(const OutputMessage_ptr& msg)
{
protocol->onSendMessage(msg);
try {
writeTimer.expires_from_now(boost::posix_time::seconds(Connection::write_timeout));
writeTimer.expires_from_now(boost::posix_time::seconds(CONNECTION_WRITE_TIMEOUT));
writeTimer.async_wait(std::bind(&Connection::handleTimeout, std::weak_ptr<Connection>(shared_from_this()),
std::placeholders::_1));

Expand Down
6 changes: 3 additions & 3 deletions src/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

#include "networkmessage.h"

static constexpr int32_t CONNECTION_WRITE_TIMEOUT = 30;
static constexpr int32_t CONNECTION_READ_TIMEOUT = 30;

class Protocol;
using Protocol_ptr = std::shared_ptr<Protocol>;
class OutputMessage;
Expand Down Expand Up @@ -63,9 +66,6 @@ class Connection : public std::enable_shared_from_this<Connection>
Connection(const Connection&) = delete;
Connection& operator=(const Connection&) = delete;

enum { write_timeout = 30 };
enum { read_timeout = 30 };

enum ConnectionState_t {
CONNECTION_STATE_OPEN,
CONNECTION_STATE_CLOSED,
Expand Down
4 changes: 2 additions & 2 deletions src/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class ItemAttributes
struct PushLuaVisitor : public boost::static_visitor<> {
lua_State* L;

PushLuaVisitor(lua_State* L) : boost::static_visitor<>(), L(L) {}
explicit PushLuaVisitor(lua_State* L) : boost::static_visitor<>(), L(L) {}

void operator()(const boost::blank&) const {
lua_pushnil(L);
Expand Down Expand Up @@ -263,7 +263,7 @@ class ItemAttributes
struct SerializeVisitor : public boost::static_visitor<> {
PropWriteStream& propWriteStream;

SerializeVisitor(PropWriteStream& propWriteStream) : boost::static_visitor<>(), propWriteStream(propWriteStream) {}
explicit SerializeVisitor(PropWriteStream& propWriteStream) : boost::static_visitor<>(), propWriteStream(propWriteStream) {}

void operator()(const boost::blank&) const {
}
Expand Down
2 changes: 1 addition & 1 deletion src/signals.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Signals
{
boost::asio::signal_set set;
public:
Signals(boost::asio::io_service& service);
explicit Signals(boost::asio::io_service& service);

private:
void asyncWait();
Expand Down

0 comments on commit 7193a67

Please sign in to comment.