1 (** Fdwatcher - The main event loop. Agnostic to the type of file descriptors
9 let cbtable = Hashtbl.create 1024
11 let add_fd (evpair:fname_and_fd) (fd_other:fname_and_fd) (callback:fname_and_fd->fname_and_fd->unit) =
12 let (fname,fd) = evpair in
13 fdset := (fd::!fdset);
14 Hashtbl.replace cbtable fd (callback,(evpair,fd_other))
17 fdset:=List.filter (fun l->l<>fd) !fdset;
23 let (fds,_,_) = try Unix.select !fdset [] [] (-1.)
28 let (func,(evd,fd_other)) = Hashtbl.find cbtable elt in
32 let wtf = Printexc.to_string e in