Skip to content

Commit b98c009

Browse files
committed
unpublished listener DEFAULT_BACKLOGs
1 parent 8643947 commit b98c009

File tree

2 files changed

+17
-24
lines changed

2 files changed

+17
-24
lines changed

library/std/src/net/tcp.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -707,20 +707,16 @@ impl fmt::Debug for TcpStream {
707707
}
708708

709709
impl TcpListener {
710-
/// Default "backlog" for [`TcpListener::bind`]. See
711-
/// [`TcpListener::bind_with_backlog`] for an explanation of backlog
712-
/// values.
713-
#[unstable(feature = "bind_with_backlog", issue = "94406")]
714-
pub const DEFAULT_BACKLOG: usize = 128;
710+
/// Default listen backlog.
711+
const DEFAULT_BACKLOG: usize = 128;
715712

716713
/// Creates a new `TcpListener` which will be bound to the specified
717714
/// address.
718715
///
719716
/// The given backlog specifies the maximum number of outstanding
720717
/// connections that will be buffered in the OS waiting to be accepted by
721718
/// [`TcpListener::accept`]. The backlog argument overrides the default
722-
/// specified by [`TcpListener::DEFAULT_BACKLOG`]; that default is
723-
/// reasonable for most use cases.
719+
/// value of 128; that default is reasonable for most use cases.
724720
///
725721
/// This function is otherwise [`TcpListener::bind`]: see that
726722
/// documentation for full details of operation.
@@ -751,8 +747,7 @@ impl TcpListener {
751747
/// address. The returned listener is ready for accepting
752748
/// connections.
753749
///
754-
/// The listener will have a backlog given by
755-
/// [`TcpListener::DEFAULT_BACKLOG`]. See the documentation for
750+
/// The listener will have a backlog of 128. See the documentation for
756751
/// [`TcpListener::bind_with_backlog`] for further information.
757752
///
758753
/// Binding with a port number of 0 will request that the OS assigns a port

library/std/src/os/unix/net/listener.rs

+13-15
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,12 @@ impl fmt::Debug for UnixListener {
5454
}
5555

5656
impl UnixListener {
57-
/// Default "backlog" for [`UnixListener::bind`] and
58-
/// [`UnixListener::bind_addr`]. See [`UnixListener::bind_with_backlog`]
59-
/// for an explanation of backlog values.
60-
#[unstable(feature = "bind_with_backlog", issue = "94406")]
61-
pub const DEFAULT_BACKLOG: usize = 128;
57+
/// Default backlog for `bind` and `bind_addr`.
58+
const DEFAULT_BACKLOG: usize = 128;
6259

6360
/// Creates a new `UnixListener` bound to the specified socket.
6461
///
65-
/// The listener will have a backlog given by
66-
/// [`UnixListener::DEFAULT_BACKLOG`]. See the documentation for
62+
/// The listener will have a backlog of 128. See the documentation for
6763
/// [`UnixListener::bind_with_backlog`] for further information.
6864
///
6965
/// # Examples
@@ -87,10 +83,10 @@ impl UnixListener {
8783
/// Creates a new `UnixListener` bound to the specified socket.
8884
///
8985
/// The given backlog specifies the maximum number of outstanding
90-
/// connections that will be buffered in the OS waiting to be accepted by
91-
/// [`UnixListener::accept`]. The backlog argument overrides the default
92-
/// specified by [`UnixListener::DEFAULT_BACKLOG`]; that default is
93-
/// reasonable for most use cases.
86+
/// connections that will be buffered in the OS waiting to be accepted
87+
/// by [`UnixListener::accept`]. The backlog argument overrides the
88+
/// default backlog of 128; that default is reasonable for most use
89+
/// cases.
9490
///
9591
/// This function is otherwise [`UnixListener::bind`]: see that
9692
/// documentation for full details of operation.
@@ -133,6 +129,9 @@ impl UnixListener {
133129

134130
/// Creates a new `UnixListener` bound to the specified [`socket address`].
135131
///
132+
/// The listener will have a backlog of 128. See the documentation for
133+
/// [`UnixListener::bind_addr_with_backlog`] for further information.
134+
///
136135
/// [`socket address`]: crate::os::unix::net::SocketAddr
137136
///
138137
/// # Examples
@@ -163,10 +162,9 @@ impl UnixListener {
163162
/// Creates a new `UnixListener` bound to the specified [`socket address`].
164163
///
165164
/// The given backlog specifies the maximum number of outstanding
166-
/// connections that will be buffered in the OS waiting to be accepted by
167-
/// [`UnixListener::accept`]. The backlog argument overrides the default
168-
/// specified by [`UnixListener::DEFAULT_BACKLOG`]; that default is
169-
/// reasonable for most use cases.
165+
/// connections that will be buffered in the OS waiting to be accepted
166+
/// by [`UnixListener::accept`]. The backlog argument overrides the
167+
/// default of 128; that default is reasonable for most use cases.
170168
///
171169
/// This function is otherwise [`UnixListener::bind_addr`]: see that
172170
/// documentation for full details of operation.

0 commit comments

Comments
 (0)