You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

153 lines
9.4 KiB

  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright © 2008, 2009 Codethink Limited
  4. * Copyright © 2009 Red Hat, Inc
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published
  8. * by the Free Software Foundation; either version 2 of the licence or (at
  9. * your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General
  17. * Public License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. *
  21. * Authors: Ryan Lortie <desrt@desrt.ca>
  22. * Alexander Larsson <alexl@redhat.com>
  23. */
  24. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  25. #error "Only <gio/gio.h> can be included directly."
  26. #endif
  27. #ifndef __G_SOCKET_CLIENT_H__
  28. #define __G_SOCKET_CLIENT_H__
  29. #include <gio/giotypes.h>
  30. G_BEGIN_DECLS
  31. #define G_TYPE_SOCKET_CLIENT (g_socket_client_get_type ())
  32. #define G_SOCKET_CLIENT(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
  33. G_TYPE_SOCKET_CLIENT, GSocketClient))
  34. #define G_SOCKET_CLIENT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
  35. G_TYPE_SOCKET_CLIENT, GSocketClientClass))
  36. #define G_IS_SOCKET_CLIENT(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
  37. G_TYPE_SOCKET_CLIENT))
  38. #define G_IS_SOCKET_CLIENT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
  39. G_TYPE_SOCKET_CLIENT))
  40. #define G_SOCKET_CLIENT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
  41. G_TYPE_SOCKET_CLIENT, GSocketClientClass))
  42. typedef struct _GSocketClientPrivate GSocketClientPrivate;
  43. typedef struct _GSocketClientClass GSocketClientClass;
  44. struct _GSocketClientClass
  45. {
  46. GObjectClass parent_class;
  47. /* Padding for future expansion */
  48. void (*_g_reserved1) (void);
  49. void (*_g_reserved2) (void);
  50. void (*_g_reserved3) (void);
  51. void (*_g_reserved4) (void);
  52. void (*_g_reserved5) (void);
  53. };
  54. struct _GSocketClient
  55. {
  56. GObject parent_instance;
  57. GSocketClientPrivate *priv;
  58. };
  59. GType g_socket_client_get_type (void) G_GNUC_CONST;
  60. GSocketClient *g_socket_client_new (void);
  61. GSocketFamily g_socket_client_get_family (GSocketClient *client);
  62. void g_socket_client_set_family (GSocketClient *client,
  63. GSocketFamily family);
  64. GSocketType g_socket_client_get_socket_type (GSocketClient *client);
  65. void g_socket_client_set_socket_type (GSocketClient *client,
  66. GSocketType type);
  67. GSocketProtocol g_socket_client_get_protocol (GSocketClient *client);
  68. void g_socket_client_set_protocol (GSocketClient *client,
  69. GSocketProtocol protocol);
  70. GSocketAddress *g_socket_client_get_local_address (GSocketClient *client);
  71. void g_socket_client_set_local_address (GSocketClient *client,
  72. GSocketAddress *address);
  73. guint g_socket_client_get_timeout (GSocketClient *client);
  74. void g_socket_client_set_timeout (GSocketClient *client,
  75. guint timeout);
  76. gboolean g_socket_client_get_enable_proxy (GSocketClient *client);
  77. void g_socket_client_set_enable_proxy (GSocketClient *client,
  78. gboolean enable);
  79. GSocketConnection * g_socket_client_connect (GSocketClient *client,
  80. GSocketConnectable *connectable,
  81. GCancellable *cancellable,
  82. GError **error);
  83. GSocketConnection * g_socket_client_connect_to_host (GSocketClient *client,
  84. const gchar *host_and_port,
  85. guint16 default_port,
  86. GCancellable *cancellable,
  87. GError **error);
  88. GSocketConnection * g_socket_client_connect_to_service (GSocketClient *client,
  89. const gchar *domain,
  90. const gchar *service,
  91. GCancellable *cancellable,
  92. GError **error);
  93. GSocketConnection * g_socket_client_connect_to_uri (GSocketClient *client,
  94. const gchar *uri,
  95. guint16 default_port,
  96. GCancellable *cancellable,
  97. GError **error);
  98. void g_socket_client_connect_async (GSocketClient *client,
  99. GSocketConnectable *connectable,
  100. GCancellable *cancellable,
  101. GAsyncReadyCallback callback,
  102. gpointer user_data);
  103. GSocketConnection * g_socket_client_connect_finish (GSocketClient *client,
  104. GAsyncResult *result,
  105. GError **error);
  106. void g_socket_client_connect_to_host_async (GSocketClient *client,
  107. const gchar *host_and_port,
  108. guint16 default_port,
  109. GCancellable *cancellable,
  110. GAsyncReadyCallback callback,
  111. gpointer user_data);
  112. GSocketConnection * g_socket_client_connect_to_host_finish (GSocketClient *client,
  113. GAsyncResult *result,
  114. GError **error);
  115. void g_socket_client_connect_to_service_async (GSocketClient *client,
  116. const gchar *domain,
  117. const gchar *service,
  118. GCancellable *cancellable,
  119. GAsyncReadyCallback callback,
  120. gpointer user_data);
  121. GSocketConnection * g_socket_client_connect_to_service_finish (GSocketClient *client,
  122. GAsyncResult *result,
  123. GError **error);
  124. void g_socket_client_connect_to_uri_async (GSocketClient *client,
  125. const gchar *uri,
  126. guint16 default_port,
  127. GCancellable *cancellable,
  128. GAsyncReadyCallback callback,
  129. gpointer user_data);
  130. GSocketConnection * g_socket_client_connect_to_uri_finish (GSocketClient *client,
  131. GAsyncResult *result,
  132. GError **error);
  133. void g_socket_client_add_application_proxy (GSocketClient *client,
  134. const gchar *protocol);
  135. G_END_DECLS
  136. #endif /* __G_SOCKET_CLIENT_H___ */