mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-21 08:26:30 +00:00
Support TCP sockets HUP&RDHUP events
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
00ffc5266d
commit
dc06d7c37d
@ -511,11 +511,16 @@ impl Socket for StreamSocket {
|
||||
|
||||
fn shutdown(&self, cmd: SockShutdownCmd) -> Result<()> {
|
||||
let state = self.read_updated_state();
|
||||
match state.as_ref() {
|
||||
State::Connected(connected_stream) => connected_stream.shutdown(cmd),
|
||||
let res = match state.as_ref() {
|
||||
State::Connected(connected_stream) => connected_stream.shutdown(cmd, &self.pollee),
|
||||
// TODO: shutdown listening stream
|
||||
_ => return_errno_with_message!(Errno::EINVAL, "cannot shutdown"),
|
||||
}
|
||||
};
|
||||
|
||||
drop(state);
|
||||
poll_ifaces();
|
||||
|
||||
res
|
||||
}
|
||||
|
||||
fn addr(&self) -> Result<SocketAddr> {
|
||||
|
Reference in New Issue
Block a user