#include <unistd.h>
#endif
+/* FIXME: This should be defined in gio/gnetworking.h, which we should include;
+ * but we cannot do that without refactoring.
+ * (See: https://phabricator.freedesktop.org/D230). */
+#define TCP_NODELAY 1
+
typedef struct {
GSocketAddress *local_addr;
GMainContext *context;
/* GSocket: All socket file descriptors are set to be close-on-exec. */
g_socket_set_blocking (gsock, false);
+ /* setting TCP_NODELAY to TRUE in order to avoid packet batching */
+ g_socket_set_option (gsock, IPPROTO_TCP, TCP_NODELAY, TRUE, NULL);
+
/* Allow g_socket_bind to fail */
g_socket_bind (gsock, priv->local_addr, FALSE, NULL);
#include <unistd.h>
#endif
+/* FIXME: This should be defined in gio/gnetworking.h, which we should include;
+ * but we cannot do that without refactoring.
+ * (See: https://phabricator.freedesktop.org/D230). */
+#define TCP_NODELAY 1
+
typedef struct {
NiceAddress remote_addr;
GQueue send_queue;
/* GSocket: All socket file descriptors are set to be close-on-exec. */
g_socket_set_blocking (gsock, false);
+ /* setting TCP_NODELAY to TRUE in order to avoid packet batching */
+ g_socket_set_option (gsock, IPPROTO_TCP, TCP_NODELAY, TRUE, NULL);
+
gret = g_socket_connect (gsock, gaddr, NULL, &gerr);
g_object_unref (gaddr);
#include <unistd.h>
#endif
+/* FIXME: This should be defined in gio/gnetworking.h, which we should include;
+ * but we cannot do that without refactoring.
+ * (See: https://phabricator.freedesktop.org/D230). */
+#define TCP_NODELAY 1
+
typedef struct {
GMainContext *context;
GHashTable *connections;
/* GSocket: All socket file descriptors are set to be close-on-exec. */
g_socket_set_blocking (gsock, false);
+ /* setting TCP_NODELAY to TRUE in order to avoid packet batching */
+ g_socket_set_option (gsock, IPPROTO_TCP, TCP_NODELAY, TRUE, NULL);
+
gaddr = g_socket_get_remote_address (gsock, NULL);
if (gaddr == NULL ||
!g_socket_address_to_native (gaddr, &name.addr, sizeof (name), NULL)) {