]> code.citadel.org Git - citadel.git/blobdiff - citadel/event_client.h
Implement asynchroneous networking.
[citadel.git] / citadel / event_client.h
index de36f29ed126b31c3c82d4ec0ffb6bf2984961ad..1e8ba4fb500db62b7766b183dc7cd47835c105bd 100644 (file)
@@ -14,13 +14,19 @@ typedef struct AsyncIO AsyncIO;
 typedef enum _eNextState {
        eSendDNSQuery,
        eReadDNSReply,
+
        eDBQuery,
+
        eConnect,
        eSendReply, 
        eSendMore,
+       eSendFile,
+
        eReadMessage, 
        eReadMore,
        eReadPayload,
+       eReadFile,
+
        eTerminateConnection,
        eAbort
 }eNextState;
@@ -82,6 +88,8 @@ struct AsyncIO {
        IOBuffer SendBuf, 
                RecvBuf;
 
+       FDIOBuffer IOB; /* when sending from / reading into files, this is used. */
+
        /* our events... */
        ev_cleanup abort_by_shutdown, /* server wants to go down... */
                db_abort_by_shutdown; /* server wants to go down... */
@@ -102,6 +110,7 @@ struct AsyncIO {
                Terminate,    /* shutting down... */
                Timeout,      /* Timeout handler; may also be connection timeout */
                ConnFail,     /* What to do when one connection failed? */
+               DNSFail,      /* the dns lookup didn't work out. */
                ShutdownAbort,/* we're going down. make your piece. */ 
                NextDBOperation; /* Perform Database IO */