我正在尝试在使用HTTP library与DGS网站连接的程序中实现以下模式:
它在Linux上运行良好,但是从Windows开始,程序在第四步打印Network.Browser.request: Error raised ErrorClosed
。我已将上述模式提炼为以下最小测试用例:
import Control.Concurrent
import Network.Browser
import Network.HTTP
import Network.URI
auth = URIAuth
{ uriRegName = "dragongoserver.sourceforge.net"
, uriUserInfo = ""
, uriPort = ""
}
uri path = nullURI
{ uriScheme = "http:"
, uriAuthority = Just auth
, uriPath = '/' : path
}
get path = request . formToRequest . Form GET (uri path)
main = browse $ do
get "login.php" [("quick_mode", "1"), ("userid", "smartypants"), ("passwd", "smartypants")]
ioAction (threadDelay 5000000)
get "sgf.php" [("gid", "491179")]
如何保持连接打开?