Haskell.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
thread

ghci

Julian Assange

22 Oct 2001 22 Oct '01
5:55 a.m.

The following code works fine under ghc, but produces a strange error under ghci: Main> main *** Exception: failed Action: connect Reason: Unknown error 141312000 It is deterministic - i.e I have verified that it isn't a network fault. module Main(main) where import Socket import IO(hPutStr,hFlush,hGetLine) alexa_host = "iq.org." main = connectUp alexa_host 80 connectUp :: Hostname -> Integer -> IO () connectUp host port = do h <- connectTo host (PortNumber (fromIntegral port)) hPutStr h "GET / HTTP/1.0 \r\n\r\n" hFlush h line <- hGetLine h putStrLn line Additionally, I'm a little confused about how to import the PortNumber constructor from Socket, without importing everything else. It's behavior seems odd.

0 0
Reply
Sign in to reply online Use email software

Back to the thread

Back to the list

HyperKitty Powered by HyperKitty version 1.3.9.