0

I'm running a small Scotty Example with Haskell. The editor I use is VsCode with the haskell language server. I use Stack as build tool for the Haskell project. The problem occurs when I stop the debug session, then there is a timout after 2000ms for 'terminate' warning in VsCode and ghci-dap isn't closing. I have to force quit the debugger in VsCode, but then I can't restart the debugging because the port is still occupied. When typing sudo lsof -i:3000 in the cli I can still see ghci-dap listening on port 3000. Why isn't it shutting down by itself? And why this timout 2000ms warning when closing debug?

My operating system is Ubuntu 20.04 GHCI version: 9.2.5

The example code:

{-# LANGUAGE OverloadedStrings #-}

import Web.Scotty (scotty, post)
import Control.Monad.IO.Class

main :: IO ()
main = scotty 3000 $ do
    get "/" $ do
        liftIO $ putStrLn "helloworld"
TheQuestioner
  • 724
  • 2
  • 8
  • 13
  • Some educational commentary at [releasing bound ports on process exit](https://stackoverflow.com/q/548879/791604). (Not 100% sure it's relevant in this case, but the linked question is definitely a topic that comes up pretty early on for just about every programmer new to network programming, and pretty much independent of language.) – Daniel Wagner Mar 22 '23 at 03:09
  • I never had such issues with other programming languages in vscode, you press F5 it starts debugging, you press it again it stops debugging. I seems to be more of a Haskell/ghci-dap related issue. – TheQuestioner Mar 22 '23 at 09:48

0 Answers0