00001 /* Gearman server and library 00002 * Copyright (C) 2008 Brian Aker, Eric Day 00003 * All rights reserved. 00004 * 00005 * Use and distribution licensed under the BSD license. See 00006 * the COPYING file in the parent directory for full text. 00007 */ 00008 00014 #ifndef __GEARMAND_CON_H__ 00015 #define __GEARMAND_CON_H__ 00016 00017 #ifdef __cplusplus 00018 extern "C" { 00019 #endif 00020 00030 struct gearmand_con_st 00031 { 00032 short last_events; 00033 int fd; 00034 gearmand_thread_st *thread; 00035 gearmand_con_st *next; 00036 gearmand_con_st *prev; 00037 gearman_server_con_st *server_con; 00038 gearman_connection_st *con; 00039 gearman_connection_add_fn *add_fn; 00040 struct event event; 00041 char host[NI_MAXHOST]; 00042 char port[NI_MAXSERV]; 00043 }; 00044 00056 GEARMAN_API 00057 gearman_return_t gearmand_con_create(gearmand_st *gearmand, int fd, 00058 const char *host, const char *port, 00059 gearman_connection_add_fn *add_fn); 00060 00065 GEARMAN_API 00066 void gearmand_con_free(gearmand_con_st *dcon); 00067 00071 GEARMAN_API 00072 void gearmand_con_check_queue(gearmand_thread_st *thread); 00073 00077 GEARMAN_API 00078 gearman_return_t gearmand_connection_watch(gearman_connection_st *con, short events, 00079 void *context); 00080 00083 #ifdef __cplusplus 00084 } 00085 #endif 00086 00087 #endif /* __GEARMAND_CON_H__ */