Issue with "connectTo" function in "network" package

Hi all, I had an issue where using the connectTo [1] function would fail to connect to "localhost" if my wireless card was turned off. The moment I turned on my wireless connection it worked. But if I use connectTo with "127.0.0.1" [2] with my network off it works. I confirmed that "localhost' resolves to "127.0.0.1" by pinging "localhost" from command line with the Internet off. Is this a bug in "connectTo"? -deech [1] connectTo "localhost" (PortNumber some_number) [2] connectTo "127.0.0.1" (PortNumber some_number)

* aditya siram
Hi all, I had an issue where using the connectTo [1] function would fail to connect to "localhost" if my wireless card was turned off. The moment I turned on my wireless connection it worked. But if I use connectTo with "127.0.0.1" [2] with my network off it works.
I confirmed that "localhost' resolves to "127.0.0.1" by pinging "localhost" from command line with the Internet off.
Is this a bug in "connectTo"?
-deech
[1] connectTo "localhost" (PortNumber some_number) [2] connectTo "127.0.0.1" (PortNumber some_number)
How exactly did it fail? Did it throw an exception? If so, what was the exception? Which operating system did you observe that under? If that was Linux, can you show the contents of the following files on that system: /etc/nsswitch.conf /etc/hosts -- Roman I. Cheplyaka :: http://ro-che.info/ "Don't let school get in the way of your education." - Mark Twain

Perhaps it was only listening on IPv6 ? ::1 ?
- jeremy
On Thu, Jun 3, 2010 at 10:30 PM, aditya siram
Hi all, I had an issue where using the connectTo [1] function would fail to connect to "localhost" if my wireless card was turned off. The moment I turned on my wireless connection it worked. But if I use connectTo with "127.0.0.1" [2] with my network off it works.
I confirmed that "localhost' resolves to "127.0.0.1" by pinging "localhost" from command line with the Internet off.
Is this a bug in "connectTo"?
-deech
[1] connectTo "localhost" (PortNumber some_number) [2] connectTo "127.0.0.1" (PortNumber some_number) _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Yeah, that seems to be the issue. When I commented out the "::1.."
line it worked.
-deech
On 6/4/10, Jeremy Shaw
Perhaps it was only listening on IPv6 ? ::1 ?
- jeremy
On Thu, Jun 3, 2010 at 10:30 PM, aditya siram
wrote: Hi all, I had an issue where using the connectTo [1] function would fail to connect to "localhost" if my wireless card was turned off. The moment I turned on my wireless connection it worked. But if I use connectTo with "127.0.0.1" [2] with my network off it works.
I confirmed that "localhost' resolves to "127.0.0.1" by pinging "localhost" from command line with the Internet off.
Is this a bug in "connectTo"?
-deech
[1] connectTo "localhost" (PortNumber some_number) [2] connectTo "127.0.0.1" (PortNumber some_number) _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Another way round -- "it" (the server) was only listening on IPv4 and
the (Haskell) client only tried to connect via IPv6.
The bug is described here (with a patch):
http://trac.haskell.org/network/ticket/30
* Jeremy Shaw
Perhaps it was only listening on IPv6 ? ::1 ?
- jeremy
On Thu, Jun 3, 2010 at 10:30 PM, aditya siram
wrote: Hi all, I had an issue where using the connectTo [1] function would fail to connect to "localhost" if my wireless card was turned off. The moment I turned on my wireless connection it worked. But if I use connectTo with "127.0.0.1" [2] with my network off it works.
I confirmed that "localhost' resolves to "127.0.0.1" by pinging "localhost" from command line with the Internet off.
Is this a bug in "connectTo"?
-deech
[1] connectTo "localhost" (PortNumber some_number) [2] connectTo "127.0.0.1" (PortNumber some_number) _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Roman I. Cheplyaka :: http://ro-che.info/ "Don't let school get in the way of your education." - Mark Twain
participants (3)
-
aditya siram
-
Jeremy Shaw
-
Roman Cheplyaka