role.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/beast
  8. //
  9. #ifndef BOOST_BEAST_ROLE_HPP
  10. #define BOOST_BEAST_ROLE_HPP
  11. #include <boost/beast/core/detail/config.hpp>
  12. namespace boost {
  13. namespace beast {
  14. /** The role of local or remote peer.
  15. Whether the endpoint is a client or server affects the
  16. behavior of teardown.
  17. The teardown behavior also depends on the type of the stream
  18. being torn down.
  19. The default implementation of teardown for regular
  20. TCP/IP sockets is as follows:
  21. @li In the client role, a TCP/IP shutdown is sent after
  22. reading all remaining data on the connection.
  23. @li In the server role, a TCP/IP shutdown is sent before
  24. reading all remaining data on the connection.
  25. When the next layer type is a `net::ssl::stream`,
  26. the connection is closed by performing the SSL closing
  27. handshake corresponding to the role type, client or server.
  28. */
  29. enum class role_type
  30. {
  31. /// The stream is operating as a client.
  32. client,
  33. /// The stream is operating as a server.
  34. server
  35. };
  36. } // beast
  37. } // boost
  38. #endif