|
|
@ -317,10 +317,8 @@ impl Socket { |
|
|
|
Ok(raw != 0) |
|
|
|
Ok(raw != 0) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO: Fix libc::FIONBIO and remove explicit cast
|
|
|
|
|
|
|
|
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { |
|
|
|
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> { |
|
|
|
let mut nonblocking = nonblocking as libc::c_int; |
|
|
|
self.0.set_nonblocking(nonblocking) |
|
|
|
cvt(unsafe { libc::ioctl(*self.as_inner(), libc::FIONBIO as u32, &mut nonblocking) }).map(|_| ()) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn take_error(&self) -> io::Result<Option<io::Error>> { |
|
|
|
pub fn take_error(&self) -> io::Result<Option<io::Error>> { |
|
|
|