errors
This commit is contained in:
@@ -93,7 +93,7 @@ impl ProtocolNetworkConnection {
|
||||
}
|
||||
}
|
||||
|
||||
// pub async fn close(&self) -> Result<(), String> {
|
||||
// pub async fn close(&self) -> io::Result<()> {
|
||||
// match self {
|
||||
// Self::Dummy(d) => d.close(),
|
||||
// Self::RawTcp(t) => t.close().await,
|
||||
|
@@ -23,21 +23,19 @@ impl RawTcpNetworkConnection {
|
||||
}
|
||||
|
||||
// #[instrument(level = "trace", err, skip(self))]
|
||||
// pub async fn close(&mut self) -> Result<(), String> {
|
||||
// pub async fn close(&mut self) -> io::Result<()> {
|
||||
// // Make an attempt to flush the stream
|
||||
// self.stream.clone().close().await.map_err(map_to_string)?;
|
||||
// self.stream.clone().close().await?;
|
||||
// // Then shut down the write side of the socket to effect a clean close
|
||||
// cfg_if! {
|
||||
// if #[cfg(feature="rt-async-std")] {
|
||||
// self.tcp_stream
|
||||
// .shutdown(async_std::net::Shutdown::Write)
|
||||
// .map_err(map_to_string)
|
||||
// } else if #[cfg(feature="rt-tokio")] {
|
||||
// use tokio::io::AsyncWriteExt;
|
||||
// self.tcp_stream.get_mut()
|
||||
// .shutdown()
|
||||
// .await
|
||||
// .map_err(map_to_string)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
@@ -71,13 +71,13 @@ where
|
||||
}
|
||||
|
||||
// #[instrument(level = "trace", err, skip(self))]
|
||||
// pub async fn close(&self) -> Result<(), String> {
|
||||
// pub async fn close(&self) -> io::Result<()> {
|
||||
// // Make an attempt to flush the stream
|
||||
// self.stream.clone().close().await.map_err(map_to_string)?;
|
||||
// self.stream.clone().close().await.map_err(to_io)?;
|
||||
// // Then forcibly close the socket
|
||||
// self.tcp_stream
|
||||
// .shutdown(Shutdown::Both)
|
||||
// .map_err(map_to_string)
|
||||
// .map_err(to_io)
|
||||
// }
|
||||
|
||||
#[instrument(level = "trace", err, skip(self, message), fields(message.len = message.len()))]
|
||||
|
Reference in New Issue
Block a user