packages feed

network-transport-tcp 0.8.5 → 0.8.6

raw patch · 4 files changed

+16/−24 lines, 4 filesdep −test-frameworkdep −test-framework-hunitdep −test-framework-quickcheck2

Dependencies removed: test-framework, test-framework-hunit, test-framework-quickcheck2

Files

ChangeLog view
@@ -1,3 +1,8 @@+2025-02-04 Laurent P. René de Cotret <laurent.decotret@outlook.com> 0.8.6++* Ported test suite to use `tasty` rather than `test-framework`.+* Addressed some compilation warnings (#467)+ 2024-09-03 Laurent P. René de Cotret <laurent.decotret@outlook.com> 0.8.5  * Bumped dependency bounds to support GHC 8.10.7 - GHC 9.10.1
network-transport-tcp.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 Name:          network-transport-tcp-Version:       0.8.5+Version:       0.8.6 Build-Type:    Simple License:       BSD-3-Clause License-file:  LICENSE@@ -12,7 +12,7 @@ Bug-Reports:   https://github.com/haskell-distributed/distributed-process/issues Synopsis:      TCP instantiation of Network.Transport Description:   TCP instantiation of Network.Transport, which can be used to create Cloud Haskell backends-tested-with:   GHC==8.10.7 GHC==9.0.2 GHC==9.2.8 GHC==9.4.5 GHC==9.6.4 GHC==9.8.2 GHC==9.10.1+tested-with:   GHC==8.10.7 GHC==9.0.2 GHC==9.2.8 GHC==9.4.5 GHC==9.6.4 GHC==9.8.2 GHC==9.10.1 GHC==9.12.1 Category:      Network extra-doc-files: ChangeLog @@ -30,6 +30,7 @@                  -Wredundant-constraints                  -fhide-source-paths                  -Wpartial-fields+                 -Wunused-packages  Flag use-mock-network   Description:     Use mock network implementation (for testing)@@ -81,9 +82,6 @@   Main-Is:        TestQC.hs   If flag(use-mock-network)     Build-Depends:  base >= 4.14 && < 5,-                    test-framework,-                    test-framework-quickcheck2,-                    test-framework-hunit,                     QuickCheck,                     HUnit,                     network-transport,
src/Network/Transport/TCP.hs view
@@ -71,7 +71,6 @@   ( prependLength   , mapIOException   , tryIO-  , tryToEnum   , void   , timeoutMaybe   , asyncWhenCancelled@@ -130,7 +129,6 @@   ) import Control.Concurrent.Async (async, wait) import Control.Category ((>>>))-import Control.Applicative ((<$>)) import Control.Monad (when, unless, join, mplus, (<=<)) import Control.Exception   ( IOException@@ -151,10 +149,10 @@   ) import Data.IORef (IORef, newIORef, writeIORef, readIORef, writeIORef) import Data.ByteString (ByteString)-import qualified Data.ByteString as BS (concat, length, null)+import qualified Data.ByteString as BS (concat, null) import qualified Data.ByteString.Char8 as BSC (pack, unpack) import Data.Bits (shiftL, (.|.))-import Data.Maybe (isJust, isNothing, fromJust)+import Data.Maybe (isJust, isNothing) import Data.Word (Word32) import Data.Set (Set) import qualified Data.Set as Set@@ -168,7 +166,6 @@   ) import Data.Map (Map) import qualified Data.Map as Map (empty)-import Data.Traversable (traverse) import Data.Accessor (Accessor, accessor, (^.), (^=), (^:)) import qualified Data.Accessor.Container as DAC (mapMaybe) import Data.Foldable (forM_, mapM_)@@ -821,8 +818,6 @@           { send  = apiSend  (ourEndPoint, theirEndPoint) connId connAlive           , close = apiClose (ourEndPoint, theirEndPoint) connId connAlive           }-  where-  params = transportParams transport  -- | Close a connection apiClose :: EndPointPair -> LightweightConnectionId -> IORef Bool -> IO ()@@ -1025,7 +1020,7 @@     handleConnectionRequestV0 :: (N.Socket, N.SockAddr) -> IO (Maybe (IO ()))     handleConnectionRequestV0 (sock, sockAddr) = do       -- Get the OS-determined host and port.-      (numericHost, resolvedHost, actualPort) <-+      (numericHost, resolvedHost, _actualPort) <-         resolveSockAddr sockAddr >>=           maybe (throwIO (userError "handleConnectionRequest: invalid socket address")) return       -- The peer must send our identifier and their address promptly, if a@@ -1304,7 +1299,7 @@      -- Close the socket (if we don't have any outgoing connections)     closeSocket :: N.Socket -> LightweightConnectionId -> IO Bool-    closeSocket sock lastReceivedId = do+    closeSocket _sock lastReceivedId = do       mAct <- modifyMVar theirState $ \st -> do         case st of           RemoteEndPointInvalid _ ->@@ -1388,8 +1383,8 @@               "handleIncomingMessages:closeSocket (closed)"       case mAct of         Nothing -> return False-        Just act -> do-          runScheduledAction (ourEndPoint, theirEndPoint) act+        Just act' -> do+          runScheduledAction (ourEndPoint, theirEndPoint) act'           return True      -- Read a message and output it on the endPoint's channel. By rights we@@ -2013,7 +2008,7 @@ -- However, it will then wait until @p@ is executed (by this call to -- 'runScheduledAction' or by another). runScheduledAction :: EndPointPair -> Action a -> IO a-runScheduledAction (ourEndPoint, theirEndPoint) mvar = do+runScheduledAction (_ourEndPoint, theirEndPoint) mvar = do     join $ readChan (remoteScheduled theirEndPoint)     ma <- readMVar mvar     case ma of
tests/TestTCP.hs view
@@ -27,14 +27,11 @@                                , putMVar                                , takeMVar                                , readMVar-                               , isEmptyMVar                                , newMVar                                , modifyMVar                                , modifyMVar_-                               , swapMVar                                )-import Control.Monad (replicateM, guard, forM_, replicateM_, when)-import Control.Applicative ((<$>))+import Control.Monad (replicateM, guard, replicateM_, when) import Control.Exception (throwIO, try, SomeException) import Network.Transport.TCP ( socketToEndPoint ) import Network.Transport.Internal ( prependLength@@ -48,7 +45,6 @@   , decodeControlHeader   , ConnectionRequestResponse(..)   , encodeConnectionRequestResponse-  , decodeConnectionRequestResponse   , encodeWord32   , recvWord32   , forkServer@@ -63,12 +59,10 @@ import qualified Network.Socket as N #endif   ( close-  , ServiceName   , Socket   , AddrInfo   , shutdown   , ShutdownCmd(ShutdownSend)-  , SockAddr(..)   , SocketType(Stream)   , AddrInfo(..)   , getAddrInfo