//! Socket handlers use super::*; use tokio::io::{ AsyncWrite, AsyncRead }; use tokio::task::JoinHandle; use futures::Future; use cancel::*; /// Handles a raw socket pub fn handle_socket_with_shutdown(sock_read: R, sock_write: W, shutdown: C) -> JoinHandle> where R: AsyncRead + Unpin + Send + 'static, W: AsyncWrite + Unpin + Send + 'static { tokio::spawn(async move { match { with_cancel!(async move { //TODO: How to handle reads+writes? Ok(()) }, shutdown) } { Ok(v) => v, Err(x) => Err(eyre::Report::from(x)), } }) }