gsocket: Add g_socket_receive_messages()

Add support for receiving multiple messages with a single system call,
using recvmmsg() if available. Otherwise, fall back to looping over
g_socket_receive_message().

This adds new API, g_socket_receive_messages(), and corresponding unit
tests.

https://bugzilla.gnome.org/show_bug.cgi?id=751924
This commit is contained in:
Philip Withnall
2015-06-12 08:47:37 +01:00
parent a0cefc2217
commit f62cbfc022
6 changed files with 467 additions and 3 deletions

View File

@@ -237,6 +237,13 @@ gssize g_socket_send_message (GSocket
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_2_48
gint g_socket_receive_messages (GSocket *socket,
GInputMessage *messages,
guint num_messages,
gint flags,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_2_44
gint g_socket_send_messages (GSocket *socket,
GOutputMessage *messages,