Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"InternalIOException getAddrInfo: does not exist (error 10093)" on Windows 8

Why is such simple code not working?

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

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

It results in the following error:

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

like image 317
The_Ghost Avatar asked Oct 03 '13 12:10

The_Ghost


1 Answers

You have to use withSocketsDo to initialize sockets. Like this:

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
like image 91
The_Ghost Avatar answered Sep 21 '22 15:09

The_Ghost