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 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

Related Questions

From my understanding a .wsdl file consists of an xml specification. This abstract way
From my understanding of the docs this general approach should work: begin try1 rescue
From what little understanding of Cassandra I have, it seems that data locality is
I have some not understanding actions from gnu clisp Suppose, I have some code
From my understanding, Celery is a distributed task queue, which means the only thing
From my understanding, this code: Microsoft.VisualBasic.StrDup(3, 123) should return 123123123 . Instead it returns
from my understanding obited can do both comet and xmpp ? it is better
Based on the understanding from the following: Where is allocated variable reference, in stack
From my understanding of .NET, if I use a BackgroundWorker and have an event
Can SubSonic be used with CSLA.NET? Has anyone tried this. From my understanding SubSonic

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.