Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails with misleading error on Windows #12

Open
fegu opened this issue Apr 6, 2013 · 0 comments
Open

Fails with misleading error on Windows #12

fegu opened this issue Apr 6, 2013 · 0 comments

Comments

@fegu
Copy link

fegu commented Apr 6, 2013

Running on windows with code copied directly from example and docs one gets the potentially confusing error "getAddrInfo: does not exist (error 10093)".

This is a common (and misleading) error for all Haskell networking code on Windows (see http://hackage.haskell.org/trac/ghc/ticket/4454)

The solution is to wrap the forkServer with:
withSocketsDo $ forkServer (BS8.pack "localhost") 8000

and also adding:
import Network.Socket (withSocketsDo)

This is best practice on all code, not only for Windows, since this adds Windows support without breaking anything on other platforms.

Proposed solution: adding withSocketsDo inside forkServer.
Change Line 224 in monitoring.hs to:
tid <- withSocketsDo $ forkIO $ startServer counters gauges labels host port

MaxDaten added a commit to MaxDaten/ekg that referenced this issue Feb 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant