openconnect wrapper—What I learned building a Rust binary wrapper programming dealing with signals

Published: 17 July 2022
on channel: Steven Hé (Sīchàng)
59
0

[Timeline]
0:00 What is openconnect_wrapper
0:37 Why do I need this
0:52 Connecting using openconnect_wrapper
1:32 The hassle to reconnect
2:41 Reconnecting using openconnect_wrapper
3:15 Starting to look at the code
3:35 Initial version—trying out `Command`
5:18 Second commit—refresh, pipped stdin
8:48 Problem—openconnect not killed properly
10:23 Investigating how to send SIGTERM
12:20 Restructuring the code to use two loops
13:30 The function to send SIGTERM
13:54 Problem from manually killing process at reload
14:14 Potential solution using the ctrlc crate
16:37 Solution using the `drop` function (RAII)
17:32 Concluding the programming
18:00 Why I did not do this in Python instead
18:20 The little resources the wrapper uses
19:23 The end

[Sources]
openconnect_wrapper:
https://github.com/SichangHe/openconn...

Command in Rust std:
https://doc.rust-lang.org/std/process...

ctrlc—the Rust crate:
https://docs.rs/ctrlc/3.2.2/ctrlc/

How do I send a signal to a `Child` subprocess?—StackOverflow:
https://stackoverflow.com/questions/4...

Python subprocess doc:
https://docs.python.org/3/library/sub...


On this page of the site you can watch the video online openconnect wrapper—What I learned building a Rust binary wrapper programming dealing with signals with a duration of hours minute second in good quality, which was uploaded by the user Steven Hé (Sīchàng) 17 July 2022, share the link with friends and acquaintances, this video has already been watched 59 times on youtube and it was liked by 0 viewers. Enjoy your viewing!