|
| 1 | +/** |
| 2 | + * Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS) |
| 3 | + * |
| 4 | + * This file is part of libbitcoin. |
| 5 | + * |
| 6 | + * This program is free software: you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU Affero General Public License as published by |
| 8 | + * the Free Software Foundation, either version 3 of the License, or |
| 9 | + * (at your option) any later version. |
| 10 | + * |
| 11 | + * This program is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU Affero General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU Affero General Public License |
| 17 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + */ |
| 19 | +#ifndef LIBBITCOIN_NODE_CHANNELS_CHANNEL_WEBSOCKET_HPP |
| 20 | +#define LIBBITCOIN_NODE_CHANNELS_CHANNEL_WEBSOCKET_HPP |
| 21 | + |
| 22 | +#include <memory> |
| 23 | +#include <bitcoin/node/channels/channel.hpp> |
| 24 | +#include <bitcoin/node/configuration.hpp> |
| 25 | +#include <bitcoin/node/define.hpp> |
| 26 | + |
| 27 | +namespace libbitcoin { |
| 28 | +namespace node { |
| 29 | + |
| 30 | +/// Abstract base websocket channel state for the node. |
| 31 | +class BCN_API channel_websocket |
| 32 | + : public network::channel_websocket, |
| 33 | + public node::channel |
| 34 | +{ |
| 35 | +public: |
| 36 | + typedef std::shared_ptr<node::channel_websocket> ptr; |
| 37 | + using options_t = network::channel_websocket::options_t; |
| 38 | + |
| 39 | + channel_websocket(const network::logger& log, |
| 40 | + const network::socket::ptr& socket, |
| 41 | + const node::configuration& config, uint64_t identifier=zero, |
| 42 | + const options_t& options={}) NOEXCEPT |
| 43 | + : network::channel_websocket(log, socket, config.network, identifier, |
| 44 | + options), |
| 45 | + node::channel(log, socket, config, identifier) |
| 46 | + { |
| 47 | + } |
| 48 | +}; |
| 49 | + |
| 50 | +} // namespace node |
| 51 | +} // namespace libbitcoin |
| 52 | + |
| 53 | +#endif |
0 commit comments