diff --git a/Data/Conduit/Network.hs b/Data/Conduit/Network.hs
--- a/Data/Conduit/Network.hs
+++ b/Data/Conduit/Network.hs
@@ -25,6 +25,7 @@
 import Control.Monad.IO.Class (liftIO)
 import Control.Exception (bracketOnError, IOException, bracket, throwIO, SomeException, try)
 import Control.Monad (forever)
+import Control.Monad.Trans.Resource (register)
 import Control.Concurrent (forkIO)
 
 -- | Stream data from the socket.
@@ -87,7 +88,9 @@
   where
     serve lsocket = do
         (socket, _addr) <- NS.accept lsocket
-        forkIO $ runResourceT $ app (sourceSocket socket) (sinkSocket socket)
+        forkIO $ runResourceT $ do
+            _ <- register $ NS.sClose socket
+            app (sourceSocket socket) (sinkSocket socket)
 
 -- | Settings for a TCP client, specifying how to connect to the server.
 data ClientSettings = ClientSettings
@@ -99,9 +102,10 @@
 --
 -- Since 0.2.1
 runTCPClient :: ClientSettings -> Application -> IO ()
-runTCPClient (ClientSettings port host) app = do
-    socket <- getSocket host port
-    runResourceT $ app (sourceSocket socket) (sinkSocket socket)
+runTCPClient (ClientSettings port host) app = bracket
+    (getSocket host port)
+    NS.sClose
+    (\s -> runResourceT $ app (sourceSocket s) (sinkSocket s))
 
 -- | Attempt to connect to the given host/port.
 --
diff --git a/network-conduit.cabal b/network-conduit.cabal
--- a/network-conduit.cabal
+++ b/network-conduit.cabal
@@ -1,5 +1,5 @@
 Name:                network-conduit
-Version:             0.2.1
+Version:             0.2.1.1
 Synopsis:            Stream socket data using conduits.
 Description:         Stream socket data using conduits.
 License:             BSD3
@@ -10,6 +10,7 @@
 Build-type:          Simple
 Cabal-version:       >=1.8
 Homepage:            http://github.com/snoyberg/conduit
+extra-source-files:  test/main.hs
 
 flag network-bytestring
     default: False
@@ -26,6 +27,16 @@
   else
         build-depends: network               >= 2.3     && < 2.4
   ghc-options:     -Wall
+
+test-suite test
+    hs-source-dirs: test
+    main-is: main.hs
+    type: exitcode-stdio-1.0
+    cpp-options:   -DTEST
+    build-depends:   conduit
+                   , base
+                   , network-conduit
+    ghc-options:     -Wall -threaded
 
 source-repository head
   type:     git
diff --git a/test/main.hs b/test/main.hs
new file mode 100644
--- /dev/null
+++ b/test/main.hs
@@ -0,0 +1,17 @@
+import Data.Conduit
+import Data.Conduit.Network
+import Control.Concurrent (forkIO, threadDelay)
+import Control.Monad (replicateM_)
+
+main :: IO ()
+main = do
+    _ <- forkIO $ runTCPServer (ServerSettings 4000 Nothing) echo
+    threadDelay 1000
+    replicateM_ 10000
+        $ runTCPClient (ClientSettings 4000 "localhost") doNothing
+
+echo :: Application
+echo src sink = src $$ sink
+
+doNothing :: Application
+doNothing _ _ = return ()
