[jdev] Re: Re: Re: Parsing XMPP/Jabber protocol
Trejkaz Xaoza
trejkaz at trypticon.org
Tue Jan 4 07:51:48 CST 2005
On Tue, 4 Jan 2005 00:13, Heiner Wolf wrote:
> Hi,
>
> > String s1 = "<?xml version=\"1.0\"?><str";
> > String s2 = "eam><element>qwe</element></stream>";
>
> I wonder who would ever be interested in getting notification of a
> partial <stream> tag. This is a weird case and I suppose applications
> have no problem waiting for the "eam>".
The notification would be unnecessary. The actual problem is that if you have
to wait for the "eam>", you tie up a thread in your application which is
handling the wait(). So whereas it's perfectly fine for a client connected
to a single server, or even a component, a client which handled multiple
connections would need one thread open per connection. A server... well,
that would be nuts. 1,000 connected clients and you already have 1,000
threads open, which is less than practical in most cases. :-)
A parser which can parse only what is available can bypass these problems as
you can have one thread using select() and handling every socket at the same
time.
TX
--
Email: Trejkaz Xaoza <trejkaz at trypticon.org>
Web site: http://xaoza.net/
Jabber ID: trejkaz at jabber.zim.net.au
GPG Fingerprint: 9EEB 97D7 8F7B 7977 F39F A62C B8C7 BC8B 037E EA73
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
URL: <https://www.jabber.org/jdev/attachments/20050105/c43421d4/attachment-0002.pgp>
More information about the JDev
mailing list