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.
This commit is contained in:
Alexander Larsson
2009-05-15 09:10:23 +02:00
parent bd87df9e73
commit f662e7e86b
3 changed files with 141 additions and 47 deletions

View File

@@ -1077,7 +1077,9 @@ g_socket_get_fd
g_socket_get_keepalive
g_socket_get_listen_backlog
g_socket_get_local_address
g_socket_get_protocol
g_socket_get_protocol_id
g_socket_get_protocol_name
g_socket_protocol_id_lookup_by_name
g_socket_get_remote_address
g_socket_get_socket_type
g_socket_is_closed