2 * Small example program
5 let signal_callback event called fd event_type
=
6 (* Print information on the signal we received *)
7 Printf.printf
"Got signal: %d\n" (Libevent.signal event
);
10 called
:= !called
- 1;
19 let signal_event = Libevent.create
() in
21 (* Set the sigint signal *)
22 Libevent.set_signal
signal_event sigint true
23 (signal_callback signal_event (ref 2));
25 (* Add the signal to the event library *)
26 Libevent.add
signal_event None
;
28 Printf.printf
"SIGINT me please!\n";
31 (* Start the event dispatching mainloop *)