12 ms·
> One of the harder things with XMPP is that it is a badly-formed document up until the connection is closed. You need a SAX-style/event-based parser to handle
by Flowdalic 4y ago
> One of the harder things with XMPP is that it is a badly-formed document up until the connection is closed. You need a SAX-style/event-based parser to handle it.
That is a common misconception, although I am not sure of its origin. I know plenty of XMPP implementations that use an XML pull parser.
- zamalek 4y agoIt's possible by blocking the thread that's reading the XML, but now you're in thread-per-client territory, and that doesn't scale.
- Flowdalic 4y agoSmack uses an XML pull parser and non-blocking I/O. It does so by splitting the XMPP stream top-level elements first and only feeding complete elements to the pull parser.
- forty 4y agohttps://github.com/igniterealtime/Smack/blob/master/smack-xmlparser-stax/src/main/java/org/jivesoftware/smack/xml/stax/StaxXmlPullParser.java https://github.com/igniterealtime/Smack/blob/master/smack-xm... I don't see any opportunity not to block when calling "next"