[cxml-devel] CXML vs usocket

Magnus Henoch mange at freemail.hu
Wed Aug 29 14:07:35 UTC 2007


David Lichteblau <david at lichteblau.com> writes:

> Quoting Magnus Henoch (mange at freemail.hu):
>> With buffering enabled, this basically works.  However, I need to
>> process "stanzas" (Jabber term for complete elements that are children
>> of the root element) as soon as they come in, not when the buffer is
>> full or when the stream or the root element is closed.  But when I
>> disable buffering, I get (using CLISP from recent CVS):
>
> Thanks for the report.  I have committed a bugfix to CVS.  Please
> test.

It works.  Thanks!

>> It would be nice if this worked, and if additionally KLACKS:PEEK would
>> do a non-blocking read.
>
> I will have think about that one.  Would a function similar to LISTEN
> also be okay, which would return T if data is available and NIL
> otherwise?
>
> (Note that it would not guarantee a non-blocking read if the server has
> already sent some characters but not an entire event, and implementing
> that cleanly would be a lot more difficult to do.)

Thinking about it, it struck me that I could as well call LISTEN
myself; that would work for me in almost all cases.  The remaining
case is when I have received some character data - CONSUME could
immediately return what it has received so far, without waiting for
the CHARACTERS event to end.  Or could I work around that with
PEEK-CHAR and READ-CHAR on the underlying stream, discarding
characters until the next <, without confusing CXML?

Magnus



More information about the cxml-devel mailing list