killSocket' :: KeepAliveProducer -> IO ()
killSocket' p = do
  r <- timeout 100000 $ takeMVar (kapSocket p)
  case r of
    (Just h) -> do
      hClose h
      putMVar (kapSocket p) h
    Nothing -> error "timed out whilst trying to kill the socket"
killSocket' :: KeepAliveProducer -> IO ()
killSocket' p = do
  r <- timeout 100000 $ takeMVar (kapSocket p)
  case r of
    (Just h) -> do
      hClose h
      putMVar (kapSocket p) h
    Nothing -> error "timed out whilst trying to kill the socket"
killSocket' p = do
  r <- timeout 100000 $ takeMVar (kapSocket p)
  case r of
    (Just h) -> do
      hClose h
      putMVar (kapSocket p) h
    Nothing -> error "timed out whilst trying to kill the socket"