Skip to content

Commit f063262

Browse files
brianquinlanCommit Queue
authored and
Commit Queue
committed
[io/doc]: Provide more references to SocketOption.tcpNoDelay.
Bug: #52102 Change-Id: I759735acfb0a67a3c0e359d6cf4c0ecab97c6c2a CoreLibraryReviewExempt: doc-only change Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325443 Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Brian Quinlan <[email protected]>
1 parent 252bfcb commit f063262

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

sdk/lib/io/secure_socket.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ part of dart.io;
66

77
/// A TCP socket using TLS and SSL.
88
///
9-
/// A secure socket may be used as either a [Stream] or an [IOSink].
9+
/// See [Socket] for more information.
1010
abstract interface class SecureSocket implements Socket {
1111
external factory SecureSocket._(RawSecureSocket rawSocket);
1212

@@ -227,6 +227,8 @@ abstract interface class SecureSocket implements Socket {
227227
/// using the trusted certificates set in the [SecurityContext] object.
228228
/// The default [SecurityContext] object contains a built-in set of trusted
229229
/// root certificates for well-known certificate authorities.
230+
///
231+
/// See [RawSocket] for more information.
230232
abstract interface class RawSecureSocket implements RawSocket {
231233
/// Constructs a new secure client socket and connect it to the given
232234
/// host on the given port.

sdk/lib/io/socket.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ abstract interface class NetworkInterface {
205205
/// A `RawServerSocket` and provides a stream of low-level [RawSocket] objects,
206206
/// one for each connection made to the listening socket.
207207
///
208-
/// See [RawSocket] for more info.
208+
/// See [RawSocket] for more information.
209209
abstract interface class RawServerSocket implements Stream<RawSocket> {
210210
/// Listens on a given address and port.
211211
///
@@ -610,9 +610,13 @@ abstract interface class RawSocket implements Stream<RawSocketEvent> {
610610
/// Writes up to [count] bytes of the buffer from [offset] buffer offset to
611611
/// the socket.
612612
///
613-
/// The number of successfully written bytes is returned.
614-
/// This function is non-blocking and will only write data
615-
/// if buffer space is available in the socket.
613+
/// The number of successfully written bytes is returned. This function is
614+
/// non-blocking and will only write data if buffer space is available in
615+
/// the socket. This means that the number of successfully written bytes may
616+
/// be less than `count` or even 0.
617+
///
618+
/// Transmission of the buffer may be delayed unless
619+
/// [SocketOption.tcpNoDelay] is set with [RawSocket.setOption].
616620
///
617621
/// The default value for [offset] is 0, and the default value for [count] is
618622
/// `buffer.length - offset`.
@@ -719,6 +723,10 @@ abstract interface class RawSocket implements Stream<RawSocketEvent> {
719723
/// Data, as [Uint8List]s, is received by the local socket, made available
720724
/// by the [Stream] interface of this class, and can be sent to the remote
721725
/// socket through the [IOSink] interface of this class.
726+
///
727+
/// Transmission of the data sent through the [IOSink] interface may be
728+
/// delayed unless [SocketOption.tcpNoDelay] is set with
729+
/// [Socket.setOption].
722730
abstract interface class Socket implements Stream<Uint8List>, IOSink {
723731
/// Creates a new socket connection to the host and port and returns a [Future]
724732
/// that will complete with either a [Socket] once connected or an error

0 commit comments

Comments
 (0)