File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
include/bitcoin/network/protocols Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 3232namespace libbitcoin {
3333namespace network {
3434
35+ class stoppable
36+ {
37+ public:
38+ virtual void stop (const code& ec) = 0;
39+ virtual ~stoppable () = default ;
40+ };
41+
3542// / This class is thread safe, except for:
3643// / * start/started must be called on strand.
3744// / * setters should only be invoked during handshake.
@@ -40,7 +47,8 @@ namespace network {
4047// / Protocol start has no failure condition.
4148// / A protocol can only stop its channel, not the session/network.
4249class BCT_API protocol
43- : public enable_shared_from_base<protocol>, public reporter
50+ : public virtual stoppable,
51+ public enable_shared_from_base<protocol>, public reporter
4452{
4553public:
4654 typedef std::shared_ptr<protocol> ptr;
@@ -150,8 +158,8 @@ class BCT_API protocol
150158 // / Channel is stopped or code set.
151159 virtual bool stopped (const code& ec=error::success) const NOEXCEPT;
152160
153- // / Stop the channel.
154- virtual void stop (const code& ec) NOEXCEPT;
161+ // / Stop the channel (stoppable::stop) .
162+ void stop (const code& ec) NOEXCEPT override ;
155163
156164 // / Pause reading from the socket, stops timers (requires strand).
157165 virtual void pause () NOEXCEPT;
You can’t perform that action at this time.
0 commit comments