From a2a42a7561dcbc7d0ed66e2705692c096102de0e Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 5 May 2010 19:00:38 +0800 Subject: bsc_msc_ip: Attempt to disable nagle Use TCP_NODELAY on the connection to the MSC. We want small messages to be send immediately. --- openbsc/src/bsc_msc_ip.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c index e4adf03bf..3cd41f457 100644 --- a/openbsc/src/bsc_msc_ip.c +++ b/openbsc/src/bsc_msc_ip.c @@ -30,6 +30,7 @@ #include #include +#include #include #define _GNU_SOURCE @@ -917,6 +918,12 @@ static void msc_ping_timeout_cb(void *data) static void msc_connection_connected(struct bsc_msc_connection *con) { + int ret, on; + on = 1; + ret = setsockopt(con->write_queue.bfd.fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); + if (ret != 0) + LOGP(DMSC, LOGL_ERROR, "Failed to set TCP_NODELAY: %s\n", strerror(errno)); + msc_ping_timeout_cb(con); } -- cgit v1.2.3