select! {
biased;
- y = ipif.rx_stream.write_all_buf(&mut rx_queue),
+ y = ipif.rx.write_all_buf(&mut rx_queue),
if ! rx_queue.is_empty() =>
{
let () = y.context("write rx data to ipif")?;
let _ = tx_queue.pop_front();
},
- data = ipif.tx_stream.next_segment(),
+ data = ipif.tx.next_segment(),
if tx_queue.is_empty() =>
{
let data = (||{
use crate::prelude::*;
pub struct Ipif {
- pub tx_stream: t_io::Split<t_io::BufReader<t_proc::ChildStdout>>,
- pub rx_stream: t_proc::ChildStdin,
+ pub tx: t_io::Split<t_io::BufReader<t_proc::ChildStdout>>,
+ pub rx: t_proc::ChildStdin,
stderr_task: tokio::task::JoinHandle<io::Result<()>>,
child: t_proc::Child,
}
Ok::<_,io::Error>(())
});
- let tx_stream = child.stdout.take().unwrap();
- let rx_stream = child.stdin .take().unwrap();
- let tx_stream = t_io::BufReader::new(tx_stream).split(SLIP_END);
+ let tx = child.stdout.take().unwrap();
+ let rx = child.stdin .take().unwrap();
+ let tx = t_io::BufReader::new(tx).split(SLIP_END);
Ipif {
- tx_stream,
- rx_stream,
+ tx,
+ rx,
stderr_task,
child,
}
}
pub async fn quitting(mut self, ic: &InstanceConfig) {
- drop(self.tx_stream);
+ drop(self.tx);
match self.child.wait().await {
Err(e) => error!("{}: also, failed to await ipif child: {}", &ic, e),