memcache/connection.h
changeset 49 10c7dce1a043
parent 43 e5b714190dee
equal deleted inserted replaced
48:1c67f512779b 49:10c7dce1a043
     6 #include <event2/event.h>
     6 #include <event2/event.h>
     7 #include <event2/event_struct.h>
     7 #include <event2/event_struct.h>
     8 #include <event2/bufferevent.h>
     8 #include <event2/bufferevent.h>
     9 
     9 
    10 #include "server.h"
    10 #include "server.h"
       
    11 #include "request.h"
    11 #include "command.h"
    12 #include "command.h"
    12 
    13 
    13 struct memcache_conn {
    14 struct memcache_conn {
    14     // the server we are connected to
    15     // the server we are connected to
    15     struct memcache_server *server;
    16     struct memcache_server *server;
    29     struct bufferevent *bev;
    30     struct bufferevent *bev;
    30 
    31 
    31     // have we succesfully connected yet?
    32     // have we succesfully connected yet?
    32     int is_connected;
    33     int is_connected;
    33     
    34     
    34     // the request (if any) that we are currently processing - NULL for idle connections
    35     /*
    35     struct memcache_req *req;
    36      * The list of requests that we are currently processing, and a pointer to the request that is currently being
       
    37      * sent.
       
    38      *  
       
    39      * New requests are enqueued on the end of this list.
       
    40      */
       
    41     struct memcache_reqqueue_head req_queue;
       
    42     struct memcache_req *send_req;
    36 
    43 
    37     // used to track our commands
    44     // used to track our commands
    38     struct memcache_cmd cmd;
    45     struct memcache_cmd cmd;
    39 };
    46 };
    40 
    47