Commit Graph

720 Commits

Author SHA1 Message Date
Alexander Larsson
ce171195d9 Add g_inet_address_get_native_size (#583205)
This can be used to get the size of g_inet_address_to_bytes().
2009-05-25 11:33:56 +02:00
Christian Persch
54b43229f4 Use g_error_new_valist instead of a private copy of it 2009-05-23 17:53:01 +02:00
Alexander Larsson
14d53dcfa8 Fix connect on win32
We should not wait before calling connect for non-blocking connect.
Also, use the right error code for the nonblocking pending case on win32.
2009-05-20 16:40:55 +02:00
Alexander Larsson
bb66fdcce3 Fix build on win32 2009-05-20 16:40:54 +02:00
Alexander Larsson
c897cca601 Don't add unix specific APIs on win32 2009-05-20 16:40:54 +02:00
Alexander Larsson
5a46e4d140 Clarify g_cancellable_push_current docs wrt cancellable being NULL (#575013) 2009-05-20 14:55:14 +02:00
Alexander Larsson
ab29e09dac Don't dereference identifier_type if it is NULL (#579558) 2009-05-20 14:46:51 +02:00
Robert Bragg
d0d10e847f Take a reference on the gio file monitors while signaling pending file changes
It was possible for a signal handler to remove the last reference and
dispose the monitor.  If there were remaining pending_file_changes they
tried to dereference the disposed monitor.

This patch simply calls g_object_{ref,unref} around the loop that signals
the changes.
2009-05-20 14:23:53 +02:00
Alexander Larsson
6a9df8256a Use G_GSSIZE_FORMAT where needed (#577884) 2009-05-20 14:17:27 +02:00
Sjoerd Simons
7498049a16 Propagate errors from g_network_service_address_enumerator_next_async in its _finish function 2009-05-20 13:59:50 +02:00
Jonathon Jongsma
2be66c0458 Typedef GResolverClass in the standard way
It's a bit lame, but some of our C++ wrapping scripts expect objects to be
typedefed like:
    typedef struct _FooClass FooClass;
    struct {} _FooClass;

Rather than:
    typedef struct {} FooClass;

Functionally they're the same, but the former makes our lives easier in the
short term
2009-05-20 13:58:13 +02:00
Alexander Larsson
cb7a300e31 Don't return something from void function (#583229)
g_async_initable_init_async is void, don't return something from it.
2009-05-20 13:49:47 +02:00
Christian Persch
1cbdd2495d Preserve errno when using g_set_error with _() and g_strerror() 2009-05-20 13:47:55 +02:00
Christian Persch
80cfd099f3 Use g_set_error_literal
Bug #583206.
2009-05-20 13:46:39 +02:00
Alexander Larsson
c20b8d4d53 Check that close_fn is not %NULL before calling (#578499)
Some streams have no close function, so this caused a crash.
2009-05-20 13:41:25 +02:00
Sjoerd Simons
9033b37589 Add helper functions for connecting to service (#583061) 2009-05-20 12:41:50 +02:00
Dan Winship
25800ed4a3 Ignore SIGPIPE when using GSocket
http://bugzilla.gnome.org/show_bug.cgi?id=583001
2009-05-20 12:32:58 +02:00
Alexander Larsson
2ea22d8f46 Remove non-existing parameter from docs
g_unix_socket_address_abstract_names_supported has no address argument
2009-05-20 12:14:55 +02:00
Alexander Larsson
9d36c86f8a Add missing symbols to gio.symbols 2009-05-20 12:14:55 +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
6d01593b06 Clarify "current condition" in g_socket_create_source docs 2009-05-20 11:30:43 +02:00
Alexander Larsson
8088182644 Actually implement max_threads for GThreadedSocketService 2009-05-20 11:28:27 +02:00
Alexander Larsson
053f9e72b1 Add support for graceful disconnect to GTcpConnection 2009-05-20 11:19:47 +02:00
Alexander Larsson
f061765e54 Call sync close function directly in async implementation
The g_io_stream_wrapper fails since there is already an outstanding
operation (the async close).
2009-05-20 11:18:34 +02:00
Alexander Larsson
fdfdec36d0 Add send-data, a g_socket_client test case 2009-05-19 13:44:11 +02:00
Alexander Larsson
18373cfbe8 Set the listen backlog before calling listen.
If we set it after it won't be used.
2009-05-19 12:06:29 +02:00
Alexander Larsson
64383fa3d9 Fix g_unix_socket_address_abstract_names_supported docs
The previous description was a cut-n-paste from another function.
2009-05-19 11:53:42 +02:00
Alexander Larsson
0ffe722193 Add g_socket_shutdown 2009-05-19 11:52:33 +02:00
Alexander Larsson
03441e724a Document GOutputVector and GInputVector 2009-05-19 11:27:07 +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
bcba61c951 Update docs on listen backlog
Mention g_socket_set_listen_backlog in g_socket_listen.
Explain that listen backlock needs to be set before calling
listen. Also verify this with a g_return_if_fail.
2009-05-19 10:47:55 +02:00
Alexander Larsson
69130db81a Read socket state in g_socket_get_local/remote_address
Previously we saved the location in various places which is unnecessary
and sometimes even wrong. For instance, we saved the address we bound to
which may not have the final port set.
2009-05-19 10:40:27 +02:00
Alexander Larsson
f8cd1c5304 Clean up refereces to @protocol_id in g_socket_new docs
This was not fully updated from the protocol to protocol_id change.
2009-05-19 10:16:32 +02:00
Alexander Larsson
3756ddb0ee Ignore error when setting SO_REUSEADDR
The main error would be "not supported" which could happen for e.g.
unix domain sockets, we don't really care, as this is mainly something
for TCP to help out a bit.
2009-05-18 23:24:13 +02:00
Alexander Larsson
f24c7fa9cb Add support for abstract unix socket addresses 2009-05-18 21:31:28 +02:00
Alexander Larsson
d8bdc3e567 Add GError to g_socket_address_to_native
This is nice for some callers so they can report an error.
It is also required to support opional address types like
abstract paths for unix domain sockets.
2009-05-18 21:31:28 +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
e1afc6e79b Remove gtk-doc warnings
Some code was using gtk-doc comment blocks for non-gtk-doc contents, just
turn it into ordinary comments.
2009-05-18 13:07:39 +02:00
Alexander Larsson
c3f4e01627 Make all non-static functions start with underscore
We don't want to export a lot of non-namespaced internal symbols.
2009-05-18 11:27:49 +02:00
Alexander Larsson
66d49b8bde Remove g_socket_set/get_reuse_address from header
These functions have been removed.
2009-05-18 09:28:26 +02:00
Alexander Larsson
13cb011762 Add max_threads argument to g_threaded_socket_service_new 2009-05-18 08:47:49 +02:00
Paul Pogonyshev
5b683af237 Fix error message in set_mtime_atime()
Bug #578786.
2009-05-17 15:17:57 +03:00
Alexander Larsson
34e74378c9 Add test apps for highlevel socket classes
echo-server - simple echo server
httpd - simple http server
2009-05-15 21:34:14 +02:00
Alexander Larsson
67df7d43e9 Add references to highlevel classes in GSocket docs 2009-05-15 21:27:54 +02:00
Alexander Larsson
ce8361217c Import all the highlevel socket classes from gnio 2009-05-15 21:26:24 +02:00
Alexander Larsson
2597e3adc3 Remove unused variable 2009-05-15 20:58:27 +02:00
Alexander Larsson
4ade78fc3d Include stdlib.h to avoid warning
Fixes a "implicit declaration of function ‘strtol’" warning
2009-05-15 20:43:02 +02:00
Alexander Larsson
d3a2c457cb Forgot to return the allocated data in async_op_wrapper_new 2009-05-15 20:42:04 +02:00
Alexander Larsson
a48fc53251 Make cancellable pipe fds close-on-exec
GCancellable is purely an in-process thing, so ensure that no cancellable
fds accidentally leak to child processes.
2009-05-15 10:42:28 +02:00
Alexander Larsson
23424e7bcb Add padding to new classes 2009-05-15 10:28:30 +02:00