Core/NetworkIO: Handle exceptions thrown from socket constructor when retrieving remote address

This commit is contained in:
Shauren
2014-08-08 14:01:09 +02:00
parent 7c6e1b1505
commit 936db9d50d

View File

@@ -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