File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ namespace oxen::quic
24
24
25
25
class Loop
26
26
{
27
+ friend class Network ;
28
+
27
29
protected:
28
30
std::atomic<bool > running{false };
29
31
std::shared_ptr<::event_base> ev_loop;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ namespace oxen::quic
18
18
{
19
19
public:
20
20
Network (std::shared_ptr<::event_base> loop_ptr, std::thread::id loop_thread_id);
21
+ Network (std::shared_ptr<Loop> ev_loop);
21
22
Network ();
22
23
~Network ();
23
24
Original file line number Diff line number Diff line change @@ -15,7 +15,12 @@ namespace oxen::quic
15
15
Network::Network (std::shared_ptr<event_base> loop_ptr, std::thread::id thread_id) :
16
16
_loop{std::make_shared<Loop>(std::move (loop_ptr), thread_id)}
17
17
{
18
- log::trace (log_cat, " Created network context with pre-existing ev loop thread" );
18
+ log::trace (log_cat, " Created network context with pre-existing libevent loop and thread!" );
19
+ }
20
+
21
+ Network::Network (std::shared_ptr<Loop> ev_loop) : _loop{std::move (ev_loop)}
22
+ {
23
+ log::trace (log_cat, " Creating network context with pre-existing event loop!" );
19
24
}
20
25
21
26
Network::Network () : _loop{std::make_shared<Loop>()} {}
You can’t perform that action at this time.
0 commit comments