Change server address, make write to buf async
This commit is contained in:
parent
a245bc8200
commit
7795854613
2 changed files with 2 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ use tokio::signal;
|
|||
pub async fn main() -> problem_02::Result<()> {
|
||||
tracing_subscriber::fmt::try_init()?;
|
||||
|
||||
let listener = TcpListener::bind(&format!("127.0.0.1:{}", DEFAULT_PORT)).await?;
|
||||
let listener = TcpListener::bind(&format!("0.0.0.0:{}", DEFAULT_PORT)).await?;
|
||||
|
||||
server::run(listener, signal::ctrl_c()).await?;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ impl Connection {
|
|||
pub async fn write_frame(&mut self, frame: &Frame) -> crate::Result<()> {
|
||||
debug!(?frame);
|
||||
if let Frame::Response(mean) = frame {
|
||||
let _ = self.stream.write(&[mean.to_ne_bytes()[0]]);
|
||||
let _ = self.stream.write(&[mean.to_ne_bytes()[0]]).await?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue