shutdown_op.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // ssl/detail/shutdown_op.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_SSL_DETAIL_SHUTDOWN_OP_HPP
  11. #define ASIO_SSL_DETAIL_SHUTDOWN_OP_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #if !defined(ASIO_ENABLE_OLD_SSL)
  17. # include "asio/ssl/detail/engine.hpp"
  18. #endif // !defined(ASIO_ENABLE_OLD_SSL)
  19. #include "asio/detail/push_options.hpp"
  20. namespace asio {
  21. namespace ssl {
  22. namespace detail {
  23. #if !defined(ASIO_ENABLE_OLD_SSL)
  24. class shutdown_op
  25. {
  26. public:
  27. engine::want operator()(engine& eng,
  28. asio::error_code& ec,
  29. std::size_t& bytes_transferred) const
  30. {
  31. bytes_transferred = 0;
  32. return eng.shutdown(ec);
  33. }
  34. template <typename Handler>
  35. void call_handler(Handler& handler,
  36. const asio::error_code& ec,
  37. const std::size_t&) const
  38. {
  39. handler(ec);
  40. }
  41. };
  42. #endif // !defined(ASIO_ENABLE_OLD_SSL)
  43. } // namespace detail
  44. } // namespace ssl
  45. } // namespace asio
  46. #include "asio/detail/pop_options.hpp"
  47. #endif // ASIO_SSL_DETAIL_SHUTDOWN_OP_HPP