连接通过关闭同时关闭tap
This commit is contained in:
@@ -139,6 +139,9 @@ fn start_simple(
|
|||||||
) -> io::Result<()> {
|
) -> io::Result<()> {
|
||||||
let mut buf = [0; 4096];
|
let mut buf = [0; 4096];
|
||||||
loop {
|
loop {
|
||||||
|
if sender.is_close() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
let len = device_reader.read(&mut buf)?;
|
let len = device_reader.read(&mut buf)?;
|
||||||
if let Err(e) = handle(
|
if let Err(e) = handle(
|
||||||
&mut buf,
|
&mut buf,
|
||||||
|
|||||||
Reference in New Issue
Block a user