use std::{io, os, sync::mpsc};
#[cfg(windows)]
type Handle = os::windows::io::OwnedHandle;
#[cfg(unix)]
type Handle = os::unix::io::OwnedFd;
pub(crate) fn emain(handle_sender: mpsc::SyncSender<Handle>) -> io::Result<()> {
use {
interprocess::unnamed_pipe::pipe,
std::io::{prelude::*, BufReader},
};
let (tx, rx) = pipe()?;
let txh = tx.into();
handle_sender.send(txh).unwrap();
let mut buf = String::with_capacity(128);
let mut rx = BufReader::new(rx);
rx.read_line(&mut buf)?;
assert_eq!(buf.trim(), "Hello from side B!");
Ok(())
}
#[allow(dead_code)]
fn main() {}