Commit Graph

16 Commits

Author SHA1 Message Date
Dan Winship
b76b24f1b3 GSocketClient: plug two leaks
g_socket_client_connect_async() was always leaking its GCancellable,
and would also leak any GSocket that eventually failed to connect
after returning G_IO_ERROR_PENDING.
2010-08-14 16:15:39 -04:00
Dan Winship
16bafb4799 GSocketClient: add a timeout property
GSocket has a timeout flag now, but when using GSocketClient there was
no way to set the timeout until after connecting (or failing). Fix
that by adding a timeout property to GSocketClient.
2010-08-14 15:26:16 -04:00
Eduardo Lima Mitev
8673f0b06c GIO: Add G-I annotations for several methods
Specifically:
 - g_io_stream_get_input/output_stream()
 - g_socket_client_get_local_address()
 - g_socket_connection_get_socket()
 - g_socket_listener_add_address()
 - g_socket_listener_accept_socket()
 - g_socket_listener_accept()
 - g_io_extension_point_get_extensions()
2010-07-29 14:06:00 +02:00
Ryan Lortie
5b946e0504 gio/: fully remove gioalias hacks 2010-07-07 19:53:22 -04:00
Dan Winship
45067ab9e9 Fix leaks in GSocketClient and GThreadedResolver
Also update gio/tests/send-data.c to test async connection, and free
more stuff in several tests to make leaks easier to see.
2009-07-23 16:27:01 -04:00
Benjamin Otte
dfda26d1a9 Propagate the right error 2009-07-20 14:29:51 +02:00
Dan Winship
65cc5d895a Support g_main_context_push_thread_default() in gio
GFile allows for the possibility that external implementations may not
support thread-default contexts yet, via
g_file_supports_thread_contexts(). GVolumeMonitor is not yet
thread-default-context aware.

Add a test program to verify that basic gio async ops work correctly
in non-default contexts.

http://bugzilla.gnome.org/show_bug.cgi?id=579984
2009-07-01 09:02:46 -04:00
Dan Winship
53beca955e Add GCancellables to GSocket ops
Currently, to implement cancellability correctly, all synchronous
calls to GSocket must be preceded by a g_socket_condition_wait() call,
(even though GSocket does this internally as well) and all
asynchronous calls must do occasional manual
g_cancellable_is_cancelled() checks. Since it's trivial to do these
checks inside GSocket instead, and we don't particularly want to
encourage people to use the APIs non-cancellably, move the
cancellation support into GSocket and simplify the existing callers.

http://bugzilla.gnome.org/show_bug.cgi?id=586797
2009-06-30 11:42:17 -04:00
Benjamin Otte
fd22781b18 make all APIs that take inet port arguments take a guint16 2009-06-12 15:57:51 +02:00
Matthias Clasen
06144900ec Documentation and coding style fixups
Lots of pedanic changes.
2009-05-27 18:20:08 -04:00
Christian Persch
80cfd099f3 Use g_set_error_literal
Bug #583206.
2009-05-20 13:46:39 +02:00
Sjoerd Simons
9033b37589 Add helper functions for connecting to service (#583061) 2009-05-20 12:41:50 +02:00
Alexander Larsson
5cd86fbda6 Remove protocol names, instead use an enum with common protocols
The whole protocol name thing is pretty weird. The getprotobyname functions
seem to only specify one mapping for name <-> ids, so all families/types
must use the same values. Plus the values used for the protocols are
standardized by IANA, so are always the same.

So, we drop using names for protocols, intead introducing an enum with
a few commonly availible and used protocols.
2009-05-20 12:14:50 +02:00
Alexander Larsson
e1a4389cbc Rename g_socket_check_pending_error to g_socket_check_connect_result
This is only used for connect anyway, and this describes the operation
better.
2009-05-19 10:57:58 +02:00
Alexander Larsson
6ea86cc57f Update the docs for the new network APIs
This imports the network APIs into the gio reference docs, and cleans
up a bunch of gtk-doc warnings and documentation issues.
2009-05-18 13:07:43 +02:00
Alexander Larsson
ce8361217c Import all the highlevel socket classes from gnio 2009-05-15 21:26:24 +02:00