Hi, My name Iván Arias, I'm trying to connect to a server using the Network library, the code that I'm using is something like this: --- BEGIN --- module Main where import System.IO import Network main = withSocketsDo $ do handle <- connectTo "localhost" ( PortNumber 8080 ) hClose handle --- END --- It compiles correctly, but when I try to run this code, it throws an exception at connectTo. The exception's message is: - getServiceEntry: does not exists (No such service entry) Do somebody know why this happens and how to fix it? Thanks
On Wed, Oct 12, 2005 at 07:34:33PM +0200, Arias <arias@radioreykjavik.net> wrote a message of 25 lines which said:
It compiles correctly, but when I try to run this code, it throws an exception at connectTo. The exception's message is:
Which compiler? I get a "does not exist" with ghc if the host does not listen on the given port. Did you check with telnet ("telnet localhost 8080")? Your code seems to work for me.
I'm using GHC version 6.4.1. In the port 8080 I have apache listening, so the server and port is correct. I send the code to a pair of friends, one of them said that it works, the other one had the same matter than me, both using the GHC compiler version 6.4. PD: Excuse my english x) Stephane Bortzmeyer escribió:
On Wed, Oct 12, 2005 at 07:34:33PM +0200, Arias <arias@radioreykjavik.net> wrote a message of 25 lines which said:
It compiles correctly, but when I try to run this code, it throws an exception at connectTo. The exception's message is:
Which compiler? I get a "does not exist" with ghc if the host does not listen on the given port. Did you check with telnet ("telnet localhost 8080")? Your code seems to work for me.
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
On Thu, Oct 13, 2005 at 12:18:44PM +0200, Arias <arias@elleondeoro.com> wrote a message of 35 lines which said:
In the port 8080 I have apache listening, so the server and port is correct.
Excuse me but I prefer actual tests to claims. "telnet localhost 8080". (Apache may be listening only on the public IP address, for instance.)
the other one had the same matter than me, both using the GHC compiler version 6.4.
I tried with ghc 6.4 (FreeBSD and Debian) and it worked.
participants (3)
-
Arias -
Arias -
Stephane Bortzmeyer