run :: String -> Int -> WS.ServerApp -> IO r
run host port app = with (managed (withSocket host port)) $ \sock ->
    forever $ do
        -- TODO: top level handle
        (conn, _) <- S.accept sock
        a         <- async $ Control.Exception.finally (runApp' conn WS.defaultConnectionOptions app) (S.sClose conn)
        link a
        return ()
run :: String -> Int -> WS.ServerApp -> IO r
run host port app = with (managed (withSocket host port)) $ \sock ->
    forever $ do
        -- TODO: top level handle
        (conn, _) <- S.accept sock
        a         <- async $ Control.Exception.finally (runApp' conn WS.defaultConnectionOptions app) (S.sClose conn)
        link a
        return ()
run host port app = with (managed (withSocket host port)) $ \sock ->
    forever $ do
        -- TODO: top level handle
        (conn, _) <- S.accept sock
        a         <- async $ Control.Exception.finally (runApp' conn WS.defaultConnectionOptions app) (S.sClose conn)
        link a
        return ()