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.
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.
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.
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.
When you're using the threaded resolver and using a sync call
without a cancellable the resolve_sync forgot to unlock the
initial req->mutex lock, leading to a deadlock when unrefing
the request.
We want to use the protocol id for lookup in the GSocketConnection
code, so we expose it. We also make GSocket store the protocol
as an int for less memory use and to allow platform specific protocols
to be specified.
Also added g_socket_protocol_id_lookup_by_name() to allow the higher
level code to specify the name by string, and g_socket_get_protocol_name()
to get it.
We were sometimes failing in g_socket_check_pending_error because
we were not setting optlen on input and it was sometimes randomly
less than sizeof(int).
This adds:
GInitable - failable object constructor interface
GAsyncInitable - async failable object constructor interface
GSocket - Platform independent lowlevel berkely socket style object
GSocketControlMessage - For passing control messages over GSocket
GUnixFDMessage - unix fd passing socket control message
Some changes were done during the import from gnio to make things
work in glib. For instance, types were moved to other headers, header
file boiler plate were updated to glib style and gio.symbols stuff
was added.
This implements all the GIOStream file ops for local files.
We use the "fallback to output stream" for all GFileIOStream ops.
Some helpers stuff was added to the local input and output streams
so they could be reused.
There is no need to have a GIOChannel in the GPollFD in
g_cancellable_create_pollfd. All we need is an Event object that
we signal when cancelling and reset when resetting.
Also, supporting g_cancellable_get_fd on Windows using _pipe is useless
as it doesn't work with any corresponding poll() function, so just don't
support that on win32.
I tested this with the cancellation support in GSocket from gnio.