sendWithReply :: Connection -> Message
              -> Maybe Int -- ^Optional timeout in milliseconds.
              -> IO PendingCall
-- XXX a NULL PendingCall lets us track timeout errors
sendWithReply conn msg timeout = do
  withForeignPtr conn $ \conn -> do
    withForeignPtr msg $ \msg -> do
      with (nullPtr :: PendingCallP) $ \ppcp -> do
          catchOom $ connection_send_with_reply conn msg ppcp
          throwIfNull "null PPendingCall" (return ppcp)
          pcp <- peek ppcp
          throwIfNull "null PendingCall" (return pcp)
          newForeignPtr pending_call_unref pcp
sendWithReply :: Connection -> Message
              -> Maybe Int -- ^Optional timeout in milliseconds.
              -> IO PendingCall
sendWithReply conn msg timeout = do
  withForeignPtr conn $ \conn -> do
    withForeignPtr msg $ \msg -> do
      with (nullPtr :: PendingCallP) $ \ppcp -> do
          catchOom $ connection_send_with_reply conn msg ppcp
          throwIfNull "null PPendingCall" (return ppcp)
          pcp <- peek ppcp
          throwIfNull "null PendingCall" (return pcp)
          newForeignPtr pending_call_unref pcp
sendWithReply conn msg timeout = do
  withForeignPtr conn $ \conn -> do
    withForeignPtr msg $ \msg -> do
      with (nullPtr :: PendingCallP) $ \ppcp -> do
          catchOom $ connection_send_with_reply conn msg ppcp
          throwIfNull "null PPendingCall" (return ppcp)
          pcp <- peek ppcp
          throwIfNull "null PendingCall" (return pcp)
          newForeignPtr pending_call_unref pcp