+ /**
+ * SoupSocket::event:
+ * @sock: the socket
+ * @event: the event that occurred
+ * @connection: the current connection state
+ *
+ * Emitted when a network-related event occurs. See
+ * #GSocketClient::event for more details.
+ *
+ * Since: 2.38
+ **/
+ signals[EVENT] =
+ g_signal_new ("event",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ NULL,
+ G_TYPE_NONE, 2,
+ G_TYPE_SOCKET_CLIENT_EVENT,
+ G_TYPE_IO_STREAM);
+
+
+ /* properties */
+ /**
+ * SOUP_SOCKET_LOCAL_ADDRESS:
+ *
+ * Alias for the #SoupSocket:local-address property. (Address
+ * of local end of socket.)
+ **/
+ g_object_class_install_property (
+ object_class, PROP_LOCAL_ADDRESS,
+ g_param_spec_object (SOUP_SOCKET_LOCAL_ADDRESS,
+ "Local address",
+ "Address of local end of socket",
+ SOUP_TYPE_ADDRESS,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ /**
+ * SOUP_SOCKET_REMOTE_ADDRESS:
+ *
+ * Alias for the #SoupSocket:remote-address property. (Address
+ * of remote end of socket.)
+ **/
+ g_object_class_install_property (
+ object_class, PROP_REMOTE_ADDRESS,
+ g_param_spec_object (SOUP_SOCKET_REMOTE_ADDRESS,
+ "Remote address",
+ "Address of remote end of socket",
+ SOUP_TYPE_ADDRESS,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ /**
+ * SoupSocket:non-blocking:
+ *
+ * Whether or not the socket uses non-blocking I/O.
+ *
+ * #SoupSocket's I/O methods are designed around the idea of
+ * using a single codepath for both synchronous and
+ * asynchronous I/O. If you want to read off a #SoupSocket,
+ * the "correct" way to do it is to call soup_socket_read() or
+ * soup_socket_read_until() repeatedly until you have read
+ * everything you want. If it returns %SOUP_SOCKET_WOULD_BLOCK
+ * at any point, stop reading and wait for it to emit the
+ * #SoupSocket::readable signal. Then go back to the
+ * reading-as-much-as-you-can loop. Likewise, for writing to a
+ * #SoupSocket, you should call soup_socket_write() either
+ * until you have written everything, or it returns
+ * %SOUP_SOCKET_WOULD_BLOCK (in which case you wait for
+ * #SoupSocket::writable and then go back into the loop).
+ *
+ * Code written this way will work correctly with both
+ * blocking and non-blocking sockets; blocking sockets will
+ * simply never return %SOUP_SOCKET_WOULD_BLOCK, and so the
+ * code that handles that case just won't get used for them.
+ **/
+ /**
+ * SOUP_SOCKET_FLAG_NONBLOCKING:
+ *
+ * Alias for the #SoupSocket:non-blocking property. (Whether
+ * or not the socket uses non-blocking I/O.)
+ **/
+ g_object_class_install_property (
+ object_class, PROP_NON_BLOCKING,
+ g_param_spec_boolean (SOUP_SOCKET_FLAG_NONBLOCKING,
+ "Non-blocking",
+ "Whether or not the socket uses non-blocking I/O",
+ TRUE,
+ G_PARAM_READWRITE));
+ /**
+ * SOUP_SOCKET_IS_SERVER:
+ *
+ * Alias for the #SoupSocket:is-server property. (Whether or
+ * not the socket is a server socket.)
+ **/
+ g_object_class_install_property (
+ object_class, PROP_IS_SERVER,
+ g_param_spec_boolean (SOUP_SOCKET_IS_SERVER,
+ "Server",
+ "Whether or not the socket is a server socket",
+ FALSE,
+ G_PARAM_READABLE));
+ /**
+ * SOUP_SOCKET_SSL_CREDENTIALS:
+ *
+ * Alias for the #SoupSocket:ssl-creds property.
+ * (SSL credential information.)
+ **/
+ /* For historical reasons, there's only a single property
+ * here, which is a GTlsDatabase for client sockets, and
+ * a GTlsCertificate for server sockets. Whee!
+ */
+ g_object_class_install_property (
+ object_class, PROP_SSL_CREDENTIALS,
+ g_param_spec_pointer (SOUP_SOCKET_SSL_CREDENTIALS,
+ "SSL credentials",
+ "SSL credential information, passed from the session to the SSL implementation",
+ G_PARAM_READWRITE));
+ /**
+ * SOUP_SOCKET_SSL_STRICT:
+ *
+ * Alias for the #SoupSocket:ssl-strict property.
+ **/
+ g_object_class_install_property (
+ object_class, PROP_SSL_STRICT,
+ g_param_spec_boolean (SOUP_SOCKET_SSL_STRICT,
+ "Strictly validate SSL certificates",
+ "Whether certificate errors should be considered a connection error",
+ TRUE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ /**
+ * SOUP_SOCKET_SSL_FALLBACK:
+ *
+ * Alias for the #SoupSocket:ssl-fallback property.
+ **/
+ g_object_class_install_property (
+ object_class, PROP_SSL_FALLBACK,
+ g_param_spec_boolean (SOUP_SOCKET_SSL_FALLBACK,
+ "SSLv3 fallback",
+ "Use SSLv3 instead of TLS (client-side only)",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ /**
+ * SOUP_SOCKET_TRUSTED_CERTIFICATE:
+ *
+ * Alias for the #SoupSocket:trusted-certificate
+ * property.
+ **/
+ g_object_class_install_property (
+ object_class, PROP_TRUSTED_CERTIFICATE,
+ g_param_spec_boolean (SOUP_SOCKET_TRUSTED_CERTIFICATE,
+ "Trusted Certificate",
+ "Whether the server certificate is trusted, if this is an SSL socket",
+ FALSE,
+ G_PARAM_READABLE));
+ /**
+ * SOUP_SOCKET_ASYNC_CONTEXT:
+ *
+ * Alias for the #SoupSocket:async-context property. (The
+ * socket's #GMainContext.)
+ **/
+ g_object_class_install_property (
+ object_class, PROP_ASYNC_CONTEXT,
+ g_param_spec_pointer (SOUP_SOCKET_ASYNC_CONTEXT,
+ "Async GMainContext",
+ "The GMainContext to dispatch this socket's async I/O in",
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ /**
+ * SOUP_SOCKET_USE_THREAD_CONTEXT:
+ *
+ * Alias for the #SoupSocket:use-thread-context property. (Use
+ * g_main_context_get_thread_default())
+ *
+ * Since: 2.36.1
+ */
+ /**
+ * SoupSocket:use-thread-context:
+ *
+ * Use g_main_context_get_thread_default().
+ *
+ * Since: 2.36.1
+ */
+ g_object_class_install_property (
+ object_class, PROP_USE_THREAD_CONTEXT,
+ g_param_spec_boolean (SOUP_SOCKET_USE_THREAD_CONTEXT,
+ "Use thread context",
+ "Use g_main_context_get_thread_default",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ /**
+ * SOUP_SOCKET_TIMEOUT:
+ *
+ * Alias for the #SoupSocket:timeout property. (The timeout
+ * in seconds for blocking socket I/O operations.)
+ **/
+ g_object_class_install_property (
+ object_class, PROP_TIMEOUT,
+ g_param_spec_uint (SOUP_SOCKET_TIMEOUT,
+ "Timeout value",
+ "Value in seconds to timeout a blocking I/O",
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class, PROP_CLEAN_DISPOSE,
+ g_param_spec_boolean ("clean-dispose",
+ "Clean dispose",
+ "Warn on unclean dispose",
+ FALSE,
+ G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+ /**
+ * SOUP_SOCKET_TLS_CERTIFICATE:
+ *
+ * Alias for the #SoupSocket:tls-certificate
+ * property. Note that this property's value is only useful
+ * if the socket is for a TLS connection, and only reliable
+ * after some data has been transferred to or from it.
+ *
+ * Since: 2.34
+ **/
+ g_object_class_install_property (
+ object_class, PROP_TLS_CERTIFICATE,
+ g_param_spec_object (SOUP_SOCKET_TLS_CERTIFICATE,
+ "TLS certificate",
+ "The peer's TLS certificate",
+ G_TYPE_TLS_CERTIFICATE,
+ G_PARAM_READABLE));
+ /**
+ * SOUP_SOCKET_TLS_ERRORS:
+ *
+ * Alias for the #SoupSocket:tls-errors
+ * property. Note that this property's value is only useful
+ * if the socket is for a TLS connection, and only reliable
+ * after some data has been transferred to or from it.
+ *
+ * Since: 2.34
+ **/
+ g_object_class_install_property (
+ object_class, PROP_TLS_ERRORS,
+ g_param_spec_flags (SOUP_SOCKET_TLS_ERRORS,
+ "TLS errors",
+ "Errors with the peer's TLS certificate",
+ G_TYPE_TLS_CERTIFICATE_FLAGS, 0,
+ G_PARAM_READABLE));