Skip to content

Commit dc9823c

Browse files
authored
IpStack pub handle for aborting
1 parent f5ec360 commit dc9823c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ impl IpStackConfig {
8080

8181
pub struct IpStack {
8282
accept_receiver: UnboundedReceiver<IpStackStream>,
83-
_handle: JoinHandle<Result<()>>, // Just hold the task handle
83+
/// for aborting on disconnect
84+
pub handle: JoinHandle<Result<()>>,
8485
}
8586

8687
impl IpStack {
@@ -91,7 +92,7 @@ impl IpStack {
9192
let (accept_sender, accept_receiver) = mpsc::unbounded_channel::<IpStackStream>();
9293
IpStack {
9394
accept_receiver,
94-
_handle: run(config, device, accept_sender),
95+
handle: run(config, device, accept_sender),
9596
}
9697
}
9798

0 commit comments

Comments
 (0)