Skip to content

Commit

Permalink
Fix inverted meaning of TcpSocketBuffer::empty().
Browse files Browse the repository at this point in the history
whitequark committed Jan 15, 2017
1 parent 4f2c58d commit a624559
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/socket/tcp.rs
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a624559

Please sign in to comment.