summary refs log tree commit diff stats
path: root/io/channel-socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'io/channel-socket.c')
-rw-r--r--io/channel-socket.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/io/channel-socket.c b/io/channel-socket.c
index 088b49ffdb..3b7ca924ff 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -78,6 +78,17 @@ qio_channel_socket_new(void)
     return sioc;
 }
 
+int qio_channel_socket_set_send_buffer(QIOChannelSocket *ioc,
+                                       size_t size,
+                                       Error **errp)
+{
+    if (setsockopt(ioc->fd, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size)) < 0) {
+        error_setg_errno(errp, errno, "Unable to set socket send buffer size");
+        return -1;
+    }
+
+    return 0;
+}
 
 static int
 qio_channel_socket_set_fd(QIOChannelSocket *sioc,