-g_socket_client_set_protocol (GSocketClient *client,
- GSocketProtocol protocol)
+g_socket_client_set_protocol (GSocketClient *client,
+ GSocketProtocol protocol)
-g_socket_client_set_local_address (GSocketClient *client,
- GSocketAddress *address)
+g_socket_client_set_local_address (GSocketClient *client,
+ GSocketAddress *address)
g_object_class_install_property (gobject_class, PROP_TYPE,
g_param_spec_enum ("type",
g_object_class_install_property (gobject_class, PROP_TYPE,
g_param_spec_enum ("type",
g_object_class_install_property (gobject_class, PROP_PROTOCOL,
g_param_spec_enum ("protocol",
g_object_class_install_property (gobject_class, PROP_PROTOCOL,
g_param_spec_enum ("protocol",
P_("The protocol to use for socket construction, or 0 for default"),
G_TYPE_SOCKET_PROTOCOL,
G_SOCKET_PROTOCOL_DEFAULT,
P_("The protocol to use for socket construction, or 0 for default"),
G_TYPE_SOCKET_PROTOCOL,
G_SOCKET_PROTOCOL_DEFAULT,
g_object_class_install_property (gobject_class, PROP_LOCAL_ADDRESS,
g_param_spec_object ("local-address",
P_("Local address"),
P_("The local address constructed sockets will be bound to"),
G_TYPE_SOCKET_ADDRESS,
g_object_class_install_property (gobject_class, PROP_LOCAL_ADDRESS,
g_param_spec_object ("local-address",
P_("Local address"),
P_("The local address constructed sockets will be bound to"),
G_TYPE_SOCKET_ADDRESS,
GSocketConnection *
g_socket_client_connect (GSocketClient *client,
GSocketConnectable *connectable,
GSocketConnection *
g_socket_client_connect (GSocketClient *client,
GSocketConnectable *connectable,
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Unknown error on connect"));
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Unknown error on connect"));
- if (g_socket_connect (socket, address, &last_error))
+ if (g_socket_connect (socket, address, cancellable, &last_error))
* In general, @host_and_port is expected to be provided by the user (allowing
* them to give the hostname, and a port overide if necessary) and
* @default_port is expected to be provided by the application.
* In general, @host_and_port is expected to be provided by the user (allowing
* them to give the hostname, and a port overide if necessary) and
* @default_port is expected to be provided by the application.
* In the case that an IP address is given, a single connection
* attempt is made. In the case that a name is given, multiple
* connection attempts may be made, in turn and according to the
* In the case that an IP address is given, a single connection
* attempt is made. In the case that a name is given, multiple
* connection attempts may be made, in turn and according to the
-g_socket_client_connect_to_host (GSocketClient *client,
- const char *host_and_port,
- int default_port,
- GCancellable *cancellable,
- GError **error)
+g_socket_client_connect_to_host (GSocketClient *client,
+ const gchar *host_and_port,
+ guint16 default_port,
+ GCancellable *cancellable,
+ GError **error)
* In the event of any failure (DNS error, service not found, no hosts
* connectable) %NULL is returned and @error (if non-%NULL) is set
* accordingly.
* In the event of any failure (DNS error, service not found, no hosts
* connectable) %NULL is returned and @error (if non-%NULL) is set
* accordingly.
g_socket_set_blocking (data->current_socket, TRUE);
connection = g_socket_connection_factory_create_connection (data->current_socket);
g_socket_set_blocking (data->current_socket, TRUE);
connection = g_socket_connection_factory_create_connection (data->current_socket);
if (tmp_error)
set_last_error (data, tmp_error);
else if (data->last_error == NULL)
if (tmp_error)
set_last_error (data, tmp_error);
else if (data->last_error == NULL)
- g_set_error (&data->last_error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Unknown error on connect"));
+ g_set_error_literal (&data->last_error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ _("Unknown error on connect"));
- if (g_socket_connect (socket, address, &tmp_error))
+ if (g_socket_connect (socket, address, data->cancellable, &tmp_error))
g_source_set_callback (source,
(GSourceFunc) g_socket_client_socket_callback,
data, NULL);
g_source_set_callback (source,
(GSourceFunc) g_socket_client_socket_callback,
data, NULL);
void
g_socket_client_connect_async (GSocketClient *client,
GSocketConnectable *connectable,
void
g_socket_client_connect_async (GSocketClient *client,
GSocketConnectable *connectable,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)