We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2db4ff4 commit 8842a10Copy full SHA for 8842a10
library/std/src/sys/pal/unix/net.rs
@@ -213,19 +213,11 @@ impl Socket {
213
}
214
0 => {}
215
_ => {
216
- // linux returns POLLOUT|POLLERR|POLLHUP for refused connections (!), so look
217
- // for POLLHUP rather than read readiness
218
- if pollfd.revents & libc::POLLHUP != 0 {
219
- let e = self.take_error()?.unwrap_or_else(|| {
220
- io::const_io_error!(
221
- io::ErrorKind::Uncategorized,
222
- "no error set after POLLHUP",
223
- )
224
- });
225
- return Err(e);
226
- }
227
-
228
- return Ok(());
+ //Check if the socket connection is actually valid and did not raise any errors.
+ match self.take_error()?{
+ None => return Ok(()),
+ Some(e) => return Err(e)
+ };
229
230
231
0 commit comments