connection.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* Gearman server and library
  2. * Copyright (C) 2008 Brian Aker, Eric Day
  3. * All rights reserved.
  4. *
  5. * Use and distribution licensed under the BSD license. See
  6. * the COPYING file in the parent directory for full text.
  7. */
  8. #ifndef __GEARMAN_CONNECTION_H__
  9. #define __GEARMAN_CONNECTION_H__
  10. #include <sys/types.h>
  11. #include <netinet/in.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #define GEARMAN_CONNECTION_MAX_FDS 10
  16. typedef struct gearman_connection_st gearman_connection_st;
  17. struct gearman_connection_st {
  18. bool is_allocated;
  19. int fds[GEARMAN_CONNECTION_MAX_FDS];
  20. gearman_connection_state state;
  21. struct event evfifo;
  22. gearman_server_st server;
  23. gearman_result_st result;
  24. };
  25. gearman_connection_st *gearman_connection_create(gearman_connection_st *ptr);
  26. void gearman_connection_free(gearman_connection_st *ptr);
  27. gearman_connection_st *gearman_connection_clone(gearman_connection_st *clone, gearman_connection_st *ptr);
  28. bool gearman_connection_add_fd(gearman_connection_st *ptr, int fd);
  29. bool gearman_connection_buffered(gearman_connection_st *ptr);
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif /* __GEARMAN_CONNECTION_H__ */