add quit opcode to Net

This commit is contained in:
bunnie 2021-10-19 05:02:00 +08:00
parent ab3e05764e
commit afeae79d45
2 changed files with 7 additions and 4 deletions

View file

@ -25,12 +25,12 @@ pub(crate) enum Opcode {
/// [Internal] com llio interrupt callback
ComInterrupt,
/// [Internal] run the network stack code
NetPump,
/// Suspend/resume callback
SuspendResume,
/// Quit the server
Quit
}
#[derive(Debug, num_derive::FromPrimitive, num_derive::ToPrimitive)]

View file

@ -646,9 +646,12 @@ fn xmain() -> ! {
// handle an suspend/resume state stuff here. right now, it's a NOP
susres.suspend_until_resume(token).expect("couldn't execute suspend/resume");
}),
Some(Opcode::Quit) => {
log::warn!("quit received");
break;
}
None => {
log::error!("couldn't convert opcode");
break
log::error!("couldn't convert opcode: {}", msg);
}
}
}