1
Fork 0

Hide unnecessary error checking from the user

This affects the `set_non_blocking` function which cannot fail for Unix or
Windows, given correct parameters. Additionally, the short UDP write error case
has been removed as there is no such thing as "short UDP writes", instead, the
operating system will error out if the application tries to send a packet
larger than the MTU of the network path.
This commit is contained in:
Tobias Bucher 2015-02-23 23:50:32 +01:00
parent f0f7ca27de
commit d0c589d5ce
8 changed files with 35 additions and 29 deletions

View file

@ -235,9 +235,9 @@ impl UnixListener {
_ => {
let (reader, writer) = try!(unsafe { sys::os::pipe() });
try!(set_nonblocking(reader.fd(), true));
try!(set_nonblocking(writer.fd(), true));
try!(set_nonblocking(self.fd(), true));
set_nonblocking(reader.fd(), true);
set_nonblocking(writer.fd(), true);
set_nonblocking(self.fd(), true);
Ok(UnixAcceptor {
inner: Arc::new(AcceptorInner {
listener: self,