+
+int iochan_is_alive(IOCHAN chan)
+{
+ struct yaz_poll_fd fds;
+ int res;
+
+ fds.fd = chan->fd;
+ fds.input_mask = yaz_poll_read;
+ res = yaz_poll(&fds, 1, 0, 0);
+ if (res == 0)
+ return 1;
+ if (!ir_read(chan, EVENT_INPUT))
+ return 0;
+ return 1;
+}
+
+int iochan_event_loop(IOCHAN *iochans, int *watch_sig)