ゴミ箱
teardown.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016-2017 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 
10 #ifndef BOOST_BEAST_WEBSOCKET_TEARDOWN_HPP
11 #define BOOST_BEAST_WEBSOCKET_TEARDOWN_HPP
12 
13 #include <boost/beast/config.hpp>
16 #include <boost/asio/ip/tcp.hpp>
17 #include <type_traits>
18 
19 namespace boost {
20 namespace beast {
21 namespace websocket {
22 
38 template<class Socket>
39 void
41  role_type role,
42  Socket& socket,
43  error_code& ec)
44 {
45  boost::ignore_unused(role, socket, ec);
46 /*
47  If you are trying to use OpenSSL and this goes off, you need to
48  add an include for <boost/beast/websocket/ssl.hpp>.
49 
50  If you are creating an instance of beast::websocket::stream with your
51  own user defined type, you must provide an overload of teardown with
52  the corresponding signature (including the role_type).
53 */
54  static_assert(sizeof(Socket)==-1,
55  "Unknown Socket type in teardown.");
56 }
57 
85 template<
86  class Socket,
87  class TeardownHandler>
88 void
90  role_type role,
91  Socket& socket,
92  TeardownHandler&& handler)
93 {
94  boost::ignore_unused(role, socket, handler);
95 /*
96  If you are trying to use OpenSSL and this goes off, you need to
97  add an include for <boost/beast/websocket/ssl.hpp>.
98 
99  If you are creating an instance of beast::websocket::stream with your
100  own user defined type, you must provide an overload of teardown with
101  the corresponding signature (including the role_type).
102 */
103  static_assert(sizeof(Socket)==-1,
104  "Unknown Socket type in async_teardown.");
105 }
106 
107 } // websocket
108 
109 //------------------------------------------------------------------------------
110 
111 namespace websocket {
112 
128 void
129 teardown(
130  role_type role,
131  boost::asio::ip::tcp::socket& socket,
132  error_code& ec);
133 
161 template<class TeardownHandler>
162 void
164  role_type role,
165  boost::asio::ip::tcp::socket& socket,
166  TeardownHandler&& handler);
167 
168 } // websocket
169 } // beast
170 } // boost
171 
173 
174 #endif
Definition: async_result.hpp:20
role_type
Definition: role.hpp:46
void async_teardown(role_type, boost::asio::ssl::stream< AsyncStream > &stream, TeardownHandler &&handler)
Definition: ssl.ipp:48
boost::system::error_code error_code
The type of error code used by the library.
Definition: error.hpp:21
void teardown(role_type, boost::asio::ssl::stream< AsyncStream > &stream, error_code &ec)
Definition: ssl.ipp:36