caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Unix.select + Stream or ulex
@ 2007-05-24 11:33 Anastasia Gornostaeva
  0 siblings, 0 replies; only message in thread
From: Anastasia Gornostaeva @ 2007-05-24 11:33 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-24 11:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-24 11:33 Unix.select + Stream or ulex Anastasia Gornostaeva

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