#include <time.h>
Go to the source code of this file.
Data Structures | |
| struct | iochan |
Defines | |
| #define | EVENT_INPUT 0x01 |
| #define | EVENT_OUTPUT 0x02 |
| #define | EVENT_EXCEPT 0x04 |
| #define | EVENT_TIMEOUT 0x08 |
| #define | iochan_destroy(i) (void)((i)->destroyed = 1) |
| #define | iochan_getfd(i) ((i)->fd) |
| #define | iochan_setfd(i, f) ((i)->fd = (f)) |
| #define | iochan_getdata(i) ((i)->data) |
| #define | iochan_setdata(i, d) ((i)->data = d) |
| #define | iochan_getflags(i) ((i)->flags) |
| #define | iochan_setflags(i, d) ((i)->flags = d) |
| #define | iochan_setflag(i, d) ((i)->flags |= d) |
| #define | iochan_clearflag(i, d) ((i)->flags &= ~(d)) |
| #define | iochan_getflag(i, d) ((i)->flags & d ? 1 : 0) |
| #define | iochan_getfun(i) ((i)->fun) |
| #define | iochan_setfun(i, d) ((i)->fun = d) |
| #define | iochan_setevent(i, e) ((i)->force_event = (e)) |
| #define | iochan_getnext(i) ((i)->next) |
| #define | iochan_settimeout(i, t) ((i)->max_idle = (t), (i)->last_event = time(0)) |
Typedefs | |
| typedef void(* | IOC_CALLBACK )(struct iochan *i, int event) |
| typedef struct iochan * | IOCHAN |
Functions | |
| IOCHAN | iochan_create (int fd, IOC_CALLBACK cb, int flags, int port) |
| int | iochan_is_alive (IOCHAN chan) |
| int | iochan_event_loop (IOCHAN *iochans) |
| void | statserv_remove (IOCHAN pIOChannel) |
This "private" header defines various functions for the main event loop in GFS.
Definition in file eventl.h.
| #define EVENT_EXCEPT 0x04 |
Definition at line 51 of file eventl.h.
Referenced by add_listener(), iochan_event_loop(), ir_session(), and listener().
| #define EVENT_INPUT 0x01 |
Definition at line 49 of file eventl.h.
Referenced by add_listener(), inetd_connection(), iochan_event_loop(), iochan_is_alive(), ir_read(), ir_session(), listener(), new_session(), and process_z_request().
| #define EVENT_OUTPUT 0x02 |
Definition at line 50 of file eventl.h.
Referenced by iochan_event_loop(), ir_read(), ir_session(), new_session(), and process_gdu_response().
| #define EVENT_TIMEOUT 0x08 |
Definition at line 52 of file eventl.h.
Referenced by do_close_req(), iochan_event_loop(), ir_session(), and listener().
| #define iochan_clearflag | ( | i, | |||
| d | ) | ((i)->flags &= ~(d)) |
| #define iochan_destroy | ( | i | ) | (void)((i)->destroyed = 1) |
Definition at line 64 of file eventl.h.
Referenced by backend_response(), iochan_event_loop(), ir_read(), ir_session(), listener(), and statserv_closedown().
| #define iochan_getdata | ( | i | ) | ((i)->data) |
Definition at line 67 of file eventl.h.
Referenced by backend_response(), iochan_event_loop(), ir_read(), ir_session(), and listener().
| #define iochan_getnext | ( | i | ) | ((i)->next) |
| #define iochan_setdata | ( | i, | |||
| d | ) | ((i)->data = d) |
Definition at line 68 of file eventl.h.
Referenced by add_listener(), inetd_connection(), new_session(), and process_z_request().
| #define iochan_setevent | ( | i, | |||
| e | ) | ((i)->force_event = (e)) |
| #define iochan_setfd | ( | i, | |||
| f | ) | ((i)->fd = (f)) |
| #define iochan_setflag | ( | i, | |||
| d | ) | ((i)->flags |= d) |
Definition at line 71 of file eventl.h.
Referenced by ir_read(), ir_session(), and process_gdu_response().
| #define iochan_setflags | ( | i, | |||
| d | ) | ((i)->flags = d) |
| #define iochan_settimeout | ( | i, | |||
| t | ) | ((i)->max_idle = (t), (i)->last_event = time(0)) |
Definition at line 78 of file eventl.h.
Referenced by do_close_req(), inetd_connection(), new_session(), process_http_request(), and process_initRequest().
| typedef void(* IOC_CALLBACK)(struct iochan *i, int event) |
| IOCHAN iochan_create | ( | int | fd, | |
| IOC_CALLBACK | cb, | |||
| int | flags, | |||
| int | port | |||
| ) |
Definition at line 39 of file eventl.c.
References iochan::chan_id, iochan::destroyed, iochan::fd, iochan::flags, iochan::force_event, iochan::fun, iochan::last_event, log_level, log_level_initialized, iochan::max_idle, iochan::next, xmalloc, and yaz_log_module_level().
Referenced by add_listener(), inetd_connection(), new_session(), and process_z_request().
| int iochan_event_loop | ( | IOCHAN * | iochans | ) |
Definition at line 78 of file eventl.c.
References association::client_link, cs_close, destroy_association(), iochan::destroyed, EVENT_EXCEPT, EVENT_INPUT, EVENT_OUTPUT, EVENT_TIMEOUT, yaz_poll_fd::fd, iochan::fd, iochan::flags, iochan::force_event, iochan::fun, yaz_poll_fd::input_mask, iochan_destroy, iochan_getdata, iochan::last_event, log_level, iochan::max_idle, iochan::next, yaz_poll_fd::output_mask, statserv_must_terminate(), statserv_remove(), xfree, xmalloc, yaz_errno(), yaz_log(), yaz_poll(), yaz_poll_add, yaz_poll_except, yaz_poll_none, yaz_poll_read, and yaz_poll_write.
Referenced by new_session(), and statserv_sc_main().
| int iochan_is_alive | ( | IOCHAN | chan | ) |
Definition at line 63 of file eventl.c.
References EVENT_INPUT, iochan::fd, yaz_poll_fd::fd, yaz_poll_fd::input_mask, ir_read(), yaz_poll(), and yaz_poll_read.
Referenced by bend_assoc_is_alive().
| void statserv_remove | ( | IOCHAN | pIOChannel | ) |
1.5.6