| 319 | } |
| 320 | |
| 321 | void TCPServer::SendError(std::error_code ec) |
| 322 | { |
| 323 | // Skip Asio disconnect errors |
| 324 | if ((ec == asio::error::connection_aborted) || |
| 325 | (ec == asio::error::connection_refused) || |
| 326 | (ec == asio::error::connection_reset) || |
| 327 | (ec == asio::error::eof) || |
| 328 | (ec == asio::error::operation_aborted)) |
| 329 | return; |
| 330 | |
| 331 | // Skip Winsock error 995: The I/O operation has been aborted because of either a thread exit or an application request |
| 332 | if (ec.value() == 995) |
| 333 | return; |
| 334 | |
| 335 | onError(ec.value(), ec.category().name(), ec.message()); |
| 336 | } |
| 337 | |
| 338 | } // namespace Asio |
| 339 | } // namespace CppServer |