Fix boost::asio misuse that would cause lag

io_service::reset was not called before io_service::poll, meaning that new events would be really polled in the next Connection::poll call, this could lead to network lag in computers with low framerate (ie: a user with 10 fps would have 100ms lag just because of that)
This commit is contained in:
Eduardo Bart 2013-10-22 21:42:35 -02:00
parent 84b722f8c7
commit 38dec168ee
1 changed files with 2 additions and 1 deletions

View File

@ -50,8 +50,9 @@ Connection::~Connection()
void Connection::poll() void Connection::poll()
{ {
g_ioService.poll(); // reset must always be called prior to poll
g_ioService.reset(); g_ioService.reset();
g_ioService.poll();
} }
void Connection::terminate() void Connection::terminate()