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

Commit

Permalink
Set TCP_NODELAY by default (#66).
Browse files Browse the repository at this point in the history
This was documented erroneously to be set by default.
  • Loading branch information
LaurentRDC committed Jul 9, 2024
1 parent 69012eb commit 456f406
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-07-09 Laurent P. René de Cotret <[email protected]> 0.8.4

* Set TCP_NODELAY by default. The documentation erroneously reported it as the default. (#66)

2023-03-26 David Simmons-Duffin <[email protected]> 0.8.3

* Disable a flaky test
Expand Down
2 changes: 1 addition & 1 deletion network-transport-tcp.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: network-transport-tcp
Version: 0.8.3
Version: 0.8.4
Cabal-Version: >=1.10
Build-Type: Simple
License: BSD3
Expand Down
7 changes: 6 additions & 1 deletion src/Network/Transport/TCP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ data TCPParameters = TCPParameters {
-- Defaults to True.
, tcpNoDelay :: Bool
-- | Should we set TCP_KEEPALIVE on connection sockets?
-- Defaults to False.
, tcpKeepAlive :: Bool
-- | Value of TCP_USER_TIMEOUT in milliseconds
, tcpUserTimeout :: Maybe Int
Expand All @@ -536,6 +537,8 @@ data TCPParameters = TCPParameters {
--
-- Connection requests to this transport will also timeout if they don't
-- send the required data before this many microseconds.
--
-- Defaults to Nothing (no timeout).
, transportConnectTimeout :: Maybe Int
-- | Create a QDisc for an EndPoint.
, tcpNewQDisc :: forall t . IO (QDisc t)
Expand All @@ -554,10 +557,12 @@ data TCPParameters = TCPParameters {
-- This is useful when operating on untrusted networks, because the peer
-- could otherwise deny service to some victim by claiming the victim's
-- address.
-- Defaults to False.
, tcpCheckPeerHost :: Bool
-- | What to do if there's an exception when accepting a new TCP
-- connection. Throwing an exception here will cause the server to
-- terminate.
-- Defaults to `throwIO`.
, tcpServerExceptionHandler :: SomeException -> IO ()
}

Expand Down Expand Up @@ -678,7 +683,7 @@ defaultTCPParameters = TCPParameters {
tcpBacklog = N.maxListenQueue
, tcpReuseServerAddr = True
, tcpReuseClientAddr = True
, tcpNoDelay = False
, tcpNoDelay = True
, tcpKeepAlive = False
, tcpUserTimeout = Nothing
, tcpNewQDisc = simpleUnboundedQDisc
Expand Down

0 comments on commit 456f406

Please sign in to comment.