]> code.citadel.org Git - citadel.git/blobdiff - citadel/event_client.h
Libev migration:
[citadel.git] / citadel / event_client.h
index 35ce4246e214eb7d8b6f22b563928f4851507295..208a716616a7122ca8340490d2fa2511ffcc9d15 100644 (file)
@@ -16,7 +16,7 @@ typedef enum _eNextState {
 }eNextState;
 
 typedef int (*EventContextAttach)(void *Data);
-typedef eNextState (*IO_CallBack)(void *Data);
+typedef eNextState (*IO_CallBack)(AsyncIO *IO);
 typedef eReadState (*IO_LineReaderCallback)(AsyncIO *IO);
 typedef void (*ParseDNSAnswerCb)(AsyncIO*, unsigned char*, int);
 typedef void (*FreeDNSReply)(void *DNSData);
@@ -34,13 +34,13 @@ struct AsyncIO {
        struct hostent *HEnt;
        int sock;
        unsigned short dport;
-       int active_event;
                eNextState NextState;
 
        ev_timer conn_fail, 
-               conn_timeout;
+               rw_timeout;
        ev_io recv_event, 
-               send_event;
+               send_event, 
+               conn_event;
        StrBuf *ErrMsg; /* if we fail to connect, or lookup, error goes here. */
 
        /* read/send related... */
@@ -94,7 +94,11 @@ void InitEventIO(AsyncIO *IO,
                 IO_CallBack Timeout, 
                 IO_CallBack ConnFail, 
                 IO_LineReaderCallback LineReader,
-                int conn_timeout, int first_rw_timeout,
+                double conn_timeout, double first_rw_timeout,
                 int ReadFirst);
 
 int QueueQuery(ns_type Type, char *name, AsyncIO *IO, IO_CallBack PostDNS);
+
+void StopClient(AsyncIO *IO);
+
+void SetNextTimeout(AsyncIO *IO, double timeout);