[Haskell-cafe] Weird socket problem on Mac OS X

Antoine Latter aslatter at gmail.com
Thu Jun 3 19:46:02 EDT 2010

Hi Arnaud,

One thing you might want to try is to stop using the PortNumber data
constructor, and instead rely on 'fromInteger' to do the right thing.

The data constructor assumes that it's argument is in network byte order,
which won't always be the case.

It's not obvious that the constructor should be avoided - this is the second
time today I've seen this!

Take care,

On Jun 3, 2010 5:13 PM, "Arnaud Bailly" <arnaud.oqube at gmail.com> wrote:

I have the following code which works ok on Linux and Windows XP, but
fails on Mac OS X with error message:

Connect: does not exist (connection refused)

The server:

   doStartstate = do pr <- liftIO $ runProcess  ...
                                   liftIO $ threadDelay 500000
                                  st <- get
                                  put st { slimHandle = Just pr }

The client:

   fetchAnswers st msgs = liftIO $! do let port = PortNumber $
fromInteger $ port $ config st
                                       cnx <- connectTo "localhost" port

Help most welcome, thanks

Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100603/ec9a6fc6/attachment.html

More information about the Haskell-Cafe mailing list