diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-08-08 14:01:09 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-08-08 14:01:09 +0200 |
commit | 936db9d50dcb98ec20077bc2d2b3d74ceeb0ccff (patch) | |
tree | 28b5799d3a58f9112bc421ce0799319f5a9753f3 | |
parent | 7c6e1b150536f905921b1809dfb5122f5f206ce5 (diff) |
Core/NetworkIO: Handle exceptions thrown from socket constructor when retrieving remote address
-rw-r--r-- | src/server/shared/Networking/AsyncAcceptor.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server/shared/Networking/AsyncAcceptor.h b/src/server/shared/Networking/AsyncAcceptor.h index d056731bb79..64665c2b198 100644 --- a/src/server/shared/Networking/AsyncAcceptor.h +++ b/src/server/shared/Networking/AsyncAcceptor.h @@ -18,6 +18,7 @@ #ifndef __ASYNCACCEPT_H_ #define __ASYNCACCEPT_H_ +#include "Log.h" #include <boost/asio.hpp> using boost::asio::ip::tcp; @@ -49,8 +50,15 @@ private: { if (!error) { - // this-> is required here to fix an segmentation fault in gcc 4.7.2 - reason is lambdas in a templated class - std::make_shared<T>(std::move(this->_socket))->Start(); + try + { + // this-> is required here to fix an segmentation fault in gcc 4.7.2 - reason is lambdas in a templated class + std::make_shared<T>(std::move(this->_socket))->Start(); + } + catch (boost::system::system_error const& err) + { + TC_LOG_INFO("network", "Failed to retrieve client's remote address %s", err.what()); + } } // lets slap some more this-> on this so we can fix this bug with gcc 4.7.2 throwing internals in yo face |