
Hi. I use FreeBsd and get the following error during execution. "mvz_server: getAddrInfo: does not exist (servname not supported for ai_socktype)" System: FreeBsd 7.1; amd64. Haskell: ghc-7.0.3; network-2.3.0.5. The programm works well on Ubuntu and on Windows XP. The piece of code is: bindit :: String -> ServData -> IO() bindit port sd@(mvzs, clnts) = withSocketsDo $ do addrinfos <- getAddrInfo (Just (defaultHints {addrFlags = [AI_PASSIVE]})) Nothing (Just port) I googled that this error was solved in ghc 6.8. But i use ghc 7.0.3. Can anyone help me? Best Regards, Alexander

On Wed, Feb 22, 2012 at 06:26, Alexander Vasiliev
I use FreeBsd and get the following error during execution. "mvz_server: getAddrInfo: does not exist (servname not supported for ai_socktype)"
(...)
I googled that this error was solved in ghc 6.8. But i use ghc 7.0.3. Can anyone help me?
What was solved in 6.8 was that IPv6 wasn't supported properly by GHC's network library. What you're tripping over now appears to be that you're trying to bind a hostname that returns an IPv6 address to an IPv4 socket, or vice versa. Note that FreeBSD handles IPv4 vs. IPv6 differently from Windows and Linux, and is probably not well tested with the GHC libraries. It is not impossible that there is a lingering bug. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On Wed, Feb 22, 2012 at 11:14 AM, Brandon Allbery
Note that FreeBSD handles IPv4 vs. IPv6 differently from Windows and Linux, and is probably not well tested with the GHC libraries. It is not impossible that there is a lingering bug.
Yeah. I got a bug report from someone about something related to this, but they didn't offer any useful details, so it's lain fallow awhile. If this is to be fixed, someone who has BSD experience will have to step up in some capacity. Relevant: http://klickverbot.at/blog/2012/01/getaddrinfo-edge-case-behavior-on-windows...

I suppose you need to specify addrSocketType (usually Stream or
Datagram) for defaultHints.
Although it seems it is not required on recent versions of FreeBSD (>= 8.x?),
I think it is better to specify addrSocketType always.
# sorry, I forgot CC to haskell-cafe.
On Wed, Feb 22, 2012 at 8:26 PM, Alexander Vasiliev
Hi.
I use FreeBsd and get the following error during execution. "mvz_server: getAddrInfo: does not exist (servname not supported for ai_socktype)"
System: FreeBsd 7.1; amd64. Haskell: ghc-7.0.3; network-2.3.0.5.
The programm works well on Ubuntu and on Windows XP. The piece of code is:
bindit :: String -> ServData -> IO() bindit port sd@(mvzs, clnts) = withSocketsDo $ do addrinfos <- getAddrInfo (Just (defaultHints {addrFlags = [AI_PASSIVE]})) Nothing (Just port)
I googled that this error was solved in ghc 6.8. But i use ghc 7.0.3. Can anyone help me?
Best Regards, Alexander
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Thank you. I have specified addrSocketType. And now it works.
23 февраля 2012 г. 13:17 пользователь iquiw
I suppose you need to specify addrSocketType (usually Stream or Datagram) for defaultHints.
Although it seems it is not required on recent versions of FreeBSD (>= 8.x?), I think it is better to specify addrSocketType always.
# sorry, I forgot CC to haskell-cafe.
On Wed, Feb 22, 2012 at 8:26 PM, Alexander Vasiliev
wrote: Hi.
I use FreeBsd and get the following error during execution. "mvz_server: getAddrInfo: does not exist (servname not supported for ai_socktype)"
System: FreeBsd 7.1; amd64. Haskell: ghc-7.0.3; network-2.3.0.5.
The programm works well on Ubuntu and on Windows XP. The piece of code is:
bindit :: String -> ServData -> IO() bindit port sd@(mvzs, clnts) = withSocketsDo $ do addrinfos <- getAddrInfo (Just (defaultHints {addrFlags = [AI_PASSIVE]})) Nothing (Just port)
I googled that this error was solved in ghc 6.8. But i use ghc 7.0.3. Can anyone help me?
Best Regards, Alexander
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (4)
-
Alexander Vasiliev
-
Brandon Allbery
-
Bryan O'Sullivan
-
iquiw