caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anastasia Gornostaeva <ermine@ermine.pp.ru>
To: caml-list@yquem.inria.fr
Subject: Unix.select + Stream or ulex
Date: Thu, 24 May 2007 15:33:26 +0400	[thread overview]
Message-ID: <20070524113326.GA3637@ermine.home> (raw)

Hello.

I attempt to use ulex based xmlparser for xml streaming together with 
Unix.select to manage multiple connections, but I cannot figure out how to
use ulex (and Stream functions) in this case: 

let infds, _, _ = Unix.select infds [] [] time in
if infds <> [] then
  let str = String.create 1024 in
  let size = Unix.read fd str 0 1024 in
     try
        let xml = UlexBased.parser_xml (String.sub str 0 size) in
           process_xml xml    (* the str was enough to have complete xml stanza *)
     with Stream.Failure -> () (* wait for future data *)
  ...

Any idea?

Thanks
ermine


                 reply	other threads:[~2007-05-24 11:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070524113326.GA3637@ermine.home \
    --to=ermine@ermine.pp.ru \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).