eidheim / Simple-Web-Server

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
MIT License
2.61k stars 751 forks source link

【warning C4996】Why is there such a warning? #226

Open webees opened 6 years ago

webees commented 6 years ago

warning C4996

'boost::asio::basic_socket::cancel': By default, this function always fails with operation_not_supported when used on Windows XP, Windows Server 2003, or earlier. Consult documentation for details.

test C:\lib\simplewebserver\client_http.hpp 129

eidheim commented 6 years ago

I'm no help on Windows, but these systems sounds pretty old. At some point, there will be systems that we cannot support, sorry.

webees commented 6 years ago

I am in win10, vs2017.

eidheim commented 6 years ago

Aha, so this is a warning since cancel with error code is deprecated. I'll have to look into all the changes that has been made, and other deprecations that have been made. I know that also asio::io_service has been renamed to asio::io_context.

Will look through this during the summer, and make the necessary changes to remove deprecated warnings and still support older systems.

eidheim commented 6 years ago

Deprecation of https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio/reference/basic_waitable_timer/cancel/overload2.html seems like an error to me though, since this is not deprecated: https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio/reference/basic_stream_socket/cancel/overload2.html

webees commented 6 years ago

Thank you for your help.