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

  • Home
  • SEARCH
  • 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 5989111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:03:18+00:00 2026-05-22T23:03:18+00:00

I have a server at http://foobar that returns a JSON object containing information about

  • 0

I have a server at http://foobar that returns a JSON object containing information about things that happened in the past second, e.g., something like

{
    time: 2011-06-08 05:07:33,
    total: 235324,
    average: 1233
}

What’s the best way to poll this server so that I get every update? I’m guessing I don’t want to just poll the server, sleep for 1 second, and then poll again (since the polling might take some time and cause things to get delayed, so I might miss some updates). Should I do something instead like sleep for only 0.5 seconds, poll the server, and then check whether the JSON object I receive has a different timestamp from the last JSON I received?

(I’m doing this in Java, by the way, though I don’t think the language really matters.)

  • 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-22T23:03:19+00:00Added an answer on May 22, 2026 at 11:03 pm

    If you need to get every update, the server should be pushing the updates to you instead of going the other direction.

    For example, you should look into setting up a stream between the client and server so that the server can send event notifications to the client.

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

Sidebar

Related Questions

I have an HTTP server that returns large bodies in response to POST requests
I have a python script that is a http-server: http://paste2.org/p/89701 , when benchmarking it
I have a web server which returns an XML file. Lets say http://www.foo.bar/foo.php?wantXML=1 How
I have an HTTP server which is in our internal network and accessible only
I'd like to have one server make an http post request to another server.
I have a server access log, with timestamps of each http request, I'd like
I have a base URL : http://my.server.com/folder/directory/sample And a relative one : ../../other/path How
I have URLs of the form http://domain/image/⟨uuid⟩/42x42/some_name.png . The Web server (nginx) is configured
I have a script that checks responses from HTTP servers using the PEAR HTTP
I'm just looking for a nice way how to return JSON object from server

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.