Commit Graph

113 Commits

Author SHA1 Message Date
Alexander Larsson
0ffe722193 Add g_socket_shutdown 2009-05-19 11:52:33 +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
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
67df7d43e9 Add references to highlevel classes in GSocket docs 2009-05-15 21:27:54 +02:00
Alexander Larsson
f662e7e86b Store protocol by id, add lookup function for name
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.
2009-05-15 09:10:23 +02:00
Alexander Larsson
bd87df9e73 Make GSocketSourceFunc return the GSocket
This is very useful when you have multiple sockets with sources.
2009-05-14 18:12:40 +02:00
Alexander Larsson
7ffdc91f51 Set optlen before calling getsockopt
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).
2009-05-14 16:19:07 +02:00
Alexander Larsson
145cec3c93 Import GInitable, GSocket and dependencies from gnio
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.
2009-05-14 15:44:36 +02:00