mirror of
https://github.com/fafhrd91/actix-net
synced 2025-03-14 21:26:25 +01:00
fix(server): fix panic in test server
This commit is contained in:
parent
4b9f7ae46d
commit
323a2e2931
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Fix panic in test server.
|
||||||
- Minimum supported Rust version (MSRV) is now 1.71.
|
- Minimum supported Rust version (MSRV) is now 1.71.
|
||||||
|
|
||||||
## 2.5.0
|
## 2.5.0
|
||||||
|
@ -123,7 +123,9 @@ impl TestServerHandle {
|
|||||||
|
|
||||||
/// Connect to server, returning a Tokio `TcpStream`.
|
/// Connect to server, returning a Tokio `TcpStream`.
|
||||||
pub fn connect(&self) -> io::Result<TcpStream> {
|
pub fn connect(&self) -> io::Result<TcpStream> {
|
||||||
TcpStream::from_std(net::TcpStream::connect(self.addr)?)
|
let stream = net::TcpStream::connect(self.addr)?;
|
||||||
|
stream.set_nonblocking(true)?;
|
||||||
|
TcpStream::from_std(stream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user