From 38dec168ee37737ce5ca9670d2d7223b5e32d608 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Tue, 22 Oct 2013 21:42:35 -0200 Subject: [PATCH] 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) --- src/framework/net/connection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/framework/net/connection.cpp b/src/framework/net/connection.cpp index 1c53d235..d12f7b31 100644 --- a/src/framework/net/connection.cpp +++ b/src/framework/net/connection.cpp @@ -50,8 +50,9 @@ Connection::~Connection() void Connection::poll() { - g_ioService.poll(); + // reset must always be called prior to poll g_ioService.reset(); + g_ioService.poll(); } void Connection::terminate()