Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6918495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:52:00+00:00 2026-05-27T09:52:00+00:00

With the below function is based on the 0MQ Haskell bindings. I get an

  • 0

With the below function is based on the 0MQ Haskell bindings. I get an error at runtime. The error says getIntOpt: interrupted (Interrupted system call) and the program stops.

It probably has to do something with command line options that I use and then discard because of criterion?

Edit: found out that I get the error also when I leave my own code with cmdArgs away.
There is actually a much more interesting problem behind. See last paragraph here. But I have still no clue how to deal with it effectively.

    sendReceive :: B.ByteString -> IO ()
    sendReceive datastring = withContext 1 $ \context -> do
         withSocket context Req $ \requester -> do
            --putStrLn "Connecting ..."
            connect requester "tcp://192.168.35.84:5559"
            let tryOnePing (!c, !f) i = do
                send requester datastring []
                --putStrLn "Sent ..."
                r <- receive requester []
                --putStrLn "Received ..."
                return $ case B.unpack r of
                   datastring -> (c+1, f)
                   _ -> (c, f+1)
            (c,f) <- foldM tryOnePing (0,0) [1 .. 1000]
            -- c and f are not used in this example
            return ()

main = do
     n <- cmdArgsRun strlen
     let datastring  = B.pack (take (byte n) $ randomRs ('a','z') (mkStdGen 3))
     putStrLn "Starting..."
     withArgs [] $ defaultMain [bench "sendReceive" $ whnfIO (sendReceive datastring)]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:52:01+00:00Added an answer on May 27, 2026 at 9:52 am

    The bindings use the FFI helper function throwErrnoIfMinus1_, which throws an error from errno if the wrapped function returns -1. The new zeromq library expects the caller to properly handler EINTR, which isn’t happening here.

    You could ask the library maintainer to use throwErrnoIfMinus1Retry_, which retries the wrapped function automatically if it returns -1 and errno is set to EINTR.

    It looks like you can catch the IOException, but I don’t know how to get at the value of errno, even though it is stored within it (unless you want to import GHC.IO.Exception, which seems a it shady to me).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Based on the function below, it is used to load data from file .dat.
I am looking for an elegant way to call a function based on the
I have a function that makes ajax GET request and based on the value
I'm try to get a point based structure from a function called: -(NSArray *)
I typically use the below function to return the root URL if I ever
let say i have function like below function doSomethingNow(){ callSomethingInFutureNotExistNow(); } at the moment
How do I make the below function more dynamic for example commentLink and commentContainer
In my project i used this below function public function createIconMenu():NativeMenu{ var iconMenu:NativeMenu =
i want to implement next previous functionality using below function. - (void)motionEnded:(UIEventSubtype)mt withEvent:(UIEvent *)event
I'm writing code to do Xml serialization. With below function. public static string SerializeToXml(object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.