Fix inverted meaning of TcpSocketBuffer::empty().

This commit is contained in:
whitequark 2017-01-15 11:00:04 +00:00
parent c0697cf37d
commit 51d8afe579
1 changed files with 9 additions and 9 deletions

View File

@ -38,7 +38,7 @@ impl<'a> SocketBuffer<'a> {
}
fn empty(&self) -> bool {
self.length != 0
self.len() == 0
}
fn full(&self) -> bool {
@ -331,6 +331,14 @@ impl<'a> TcpSocket<'a> {
}
}
/// Return whether the socket is passively listening for incoming connections.
pub fn is_listening(&self) -> bool {
match self.state {
State::Listen => true,
_ => false
}
}
/// Return whether the socket is open.
///
/// This function returns true if the socket will process incoming or dispatch outgoing
@ -344,14 +352,6 @@ impl<'a> TcpSocket<'a> {
}
}
/// Return whether the socket is passively listening for incoming connections.
pub fn is_listening(&self) -> bool {
match self.state {
State::Listen => true,
_ => false
}
}
/// Return whether a connection is active.
///
/// This function returns true if the socket is actively exchanging packets with