Skip to content

Commit fef8ef8

Browse files
committed
feat(mioudp): don't exit on "exit"
1 parent a8acdba commit fef8ef8

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

examples/mioudp/src/main.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Adapted from <https://github.com/tokio-rs/mio/blob/c9831c78d14fd54c41bab79f5347764a56dc8326/examples/udp_server.rs>.
22
33
use std::io;
4-
use std::str::from_utf8;
54

65
#[cfg(target_os = "hermit")]
76
use hermit as _;
@@ -63,11 +62,6 @@ fn main() -> io::Result<()> {
6362
Ok((packet_size, source_address)) => {
6463
// Echo the data.
6564
socket.send_to(&buf[..packet_size], source_address)?;
66-
if let Ok(str_buf) = from_utf8(&buf[..packet_size]) {
67-
if str_buf.trim_end() == "exit" {
68-
return Ok(());
69-
}
70-
}
7165
}
7266
Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
7367
// If we get a `WouldBlock` error we know our socket

0 commit comments

Comments
 (0)