control end close message
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
8667d68c6f
commit
0812dc79b8
@ -1133,6 +1133,10 @@ impl Connection {
|
||||
Some(Instant::now().into()),
|
||||
);
|
||||
}
|
||||
Some(misc::Union::CloseReason(_)) => {
|
||||
self.on_close("Peer close", true);
|
||||
return false;
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
_ => {}
|
||||
|
@ -1633,6 +1633,11 @@ impl Remote {
|
||||
// log::info!("new msg from ui, {}",data);
|
||||
match data {
|
||||
Data::Close => {
|
||||
let mut misc = Misc::new();
|
||||
misc.set_close_reason("".to_owned());
|
||||
let mut msg = Message::new();
|
||||
msg.set_misc(misc);
|
||||
allow_err!(peer.send(&msg).await);
|
||||
return false;
|
||||
}
|
||||
Data::Login((password, remember)) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user