gpt4 book ai didi

windows - Windows 8 上的 "InternalIOException getAddrInfo: does not exist (error 10093)"

转载 作者:可可西里 更新时间:2023-11-01 12:41:07 35 4
gpt4 key购买 nike

为什么这么简单的代码不起作用?

import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy as L

main :: IO ()
main = simpleHttp "http://www.dir.bg/" >>= L.putStr

它会导致以下错误:

TestConduit.exe: InternalIOException getAddrInfo: does not exist (error 10093)

最佳答案

您必须使用withSocketsDo 来初始化套接字。像这样:

import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy as L
import Network (withSocketsDo)

main :: IO ()
main = withSocketsDo
$ simpleHttp "http://www.dir.bg/" >>= L.putStr

关于windows - Windows 8 上的 "InternalIOException getAddrInfo: does not exist (error 10093)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19159686/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com