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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:02:38+00:00 2026-05-10T15:02:38+00:00

From my understanding the XMPP protocol is based on an always-on connection where you

  • 0

From my understanding the XMPP protocol is based on an always-on connection where you have no, immediate, indication of when an XML message ends.

This means you have to evaluate the stream as it comes. This also means that, probably, you have to deal with asynchronous connections since the socket can block in the middle of an XML message, either due to message length or a connection being slow.

I would appreciate one source per answer so we can mod them up and see what’s the favourite.

  • 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. 2026-05-10T15:02:38+00:00Added an answer on May 10, 2026 at 3:02 pm

    Are you wanting to deal with multiple connections at once? Good asynch socket processing is a must in that case, to avoid one thread per connection.

    Otherwise, you just need an XML parser that can deal with a chunk of bytes at a time. Expat is the canonical example; if you’re in Java, try XP. These types of XML parsers will fire events as possible, and buffer partial stanzas until the rest arrives.

    Now, to address your assertion that there is no notification when a stanza ends, that’s not really true. The important thing is not to process the XML stream as if it is a sequence of documents. Use the following pseudo-code:

    stanza = null while parser has more:   switch on token type:      START_TAG:        elem =  create element from parser state        if stanza is not null:          add elem as child of stanza        stanza = elem      END_TAG:        parent = parent of stanza        if parent is not null:          fire OnStanza event        stanza = parent 

    This approach should work with an event-based or pull parser. It only requires holding on to one pointer worth of state. Obviously, you’ll also need to handle attributes, character data, entity references (like & and the like), and special-purpose the stream:stream tag, but this should get you started.

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

Sidebar

Ask A Question

Stats

  • Questions 248k
  • Answers 248k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When you compare two objects like this, what you are… May 13, 2026 at 8:51 am
  • Editorial Team
    Editorial Team added an answer if(!int.TryParse(range.Text, out level)) { MessageBox.Show("Please Enter Only Number"); } else… May 13, 2026 at 8:51 am
  • Editorial Team
    Editorial Team added an answer What happens when you remove the picture? Does it work… May 13, 2026 at 8:51 am

Related Questions

I have 3 tables (note this may not be the best sql db design)
We have a web app that is using MVC Preview 3. I'm new to
I am working with some legacy c++ code and I need to extend an
From my understanding of the CSS spec, a table above or below a paragraph

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.