Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 7fbd41a

Browse files
committed
Set TCP_NODELAY by default (#66).
This was documented erroneously to be set by default.
1 parent 69012eb commit 7fbd41a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-07-09 Laurent P. René de Cotret <[email protected]> 0.8.4
2+
3+
* Set TCP_NODELAY by default. The documentation erroneously reported it as the default. (#66)
4+
15
2023-03-26 David Simmons-Duffin <[email protected]> 0.8.3
26

37
* Disable a flaky test

network-transport-tcp.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: network-transport-tcp
2-
Version: 0.8.3
2+
Version: 0.8.4
33
Cabal-Version: >=1.10
44
Build-Type: Simple
55
License: BSD3

src/Network/Transport/TCP.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ data TCPParameters = TCPParameters {
525525
-- Defaults to True.
526526
, tcpNoDelay :: Bool
527527
-- | Should we set TCP_KEEPALIVE on connection sockets?
528+
-- Defaults to False.
528529
, tcpKeepAlive :: Bool
529530
-- | Value of TCP_USER_TIMEOUT in milliseconds
530531
, tcpUserTimeout :: Maybe Int
@@ -536,6 +537,8 @@ data TCPParameters = TCPParameters {
536537
--
537538
-- Connection requests to this transport will also timeout if they don't
538539
-- send the required data before this many microseconds.
540+
--
541+
-- Defaults to Nothing (no timeout).
539542
, transportConnectTimeout :: Maybe Int
540543
-- | Create a QDisc for an EndPoint.
541544
, tcpNewQDisc :: forall t . IO (QDisc t)
@@ -554,10 +557,12 @@ data TCPParameters = TCPParameters {
554557
-- This is useful when operating on untrusted networks, because the peer
555558
-- could otherwise deny service to some victim by claiming the victim's
556559
-- address.
560+
-- Defaults to False.
557561
, tcpCheckPeerHost :: Bool
558562
-- | What to do if there's an exception when accepting a new TCP
559563
-- connection. Throwing an exception here will cause the server to
560564
-- terminate.
565+
-- Defaults to `throwIO`.
561566
, tcpServerExceptionHandler :: SomeException -> IO ()
562567
}
563568

@@ -678,7 +683,7 @@ defaultTCPParameters = TCPParameters {
678683
tcpBacklog = N.maxListenQueue
679684
, tcpReuseServerAddr = True
680685
, tcpReuseClientAddr = True
681-
, tcpNoDelay = False
686+
, tcpNoDelay = True
682687
, tcpKeepAlive = False
683688
, tcpUserTimeout = Nothing
684689
, tcpNewQDisc = simpleUnboundedQDisc

0 commit comments

Comments
 (0)