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 9140425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:30:53+00:00 2026-06-17T09:30:53+00:00

So in order to know if there’s still an active data connection, I’m sending

  • 0

So in order to know if there’s still an active data connection, I’m sending a ping every like 5 minute interval, and waiting for the server to respond. So basically, I’m using the iq id as a key on this pinging method. I’ll send a ping, and store the iq id, and i’ll say assume that noDataConnection = true. Now, if I receive a pong with the same iq id, I assume that the connection is alive, so I’ll set noDataConnection = false. However, if there’s no data connection, i’ll continue to send pings setting noDataConnection = true, and never receiving any so it will remain true unless it recovers and obtained a data connection.

Excerpt from http://xmpp.org/extensions/xep-0199.html#s2c:
PING:

<iq from='juliet@capulet.lit/balcony' to='capulet.lit' id='c2s1' type='get'>
  <ping xmlns='urn:xmpp:ping'/>
</iq>

PONG:

<iq from='capulet.lit' to='juliet@capulet.lit/balcony' id='c2s1' type='result'/>

My only concern about this, is what if I received an iq that isn’t a result of my ping and my application will assume that noDataConnection = true, since the iq id that it receives doesn’t match up to my ping iq id that is sent. Is there a way to know if the iq that I received is a result of my ping?

Thanks.

  • 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-06-17T09:30:54+00:00Added an answer on June 17, 2026 at 9:30 am

    My solution is to prefix the iq id that i’ve sent with a text “ping”, so basically if i received an iq prefix with “ping”, then it is the pong of my ping.

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

Sidebar

Related Questions

1) I know there are lots of web sites that describe in what order
I know there is no guarantee without an ORDER BY clause, but are there
I know there's no single hard-and-fast answer, but is there a generic order-of-magnitude estimate
Possible Duplicate: Enable GPS programatically like Tasker Ok, I know there is same question
I know there is a way to define the order we want things in
I know there are several techniques out there to encrypt data. I am not
I would like to know if there is a way to know the 'z'
I know there are a lot of other SO entries that seem like this
I'd like to know if there is some documentation available to know how Flash
Ok so I know there's other questions like this. But mine is a little

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.