X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Finet.c;h=eb0c4fde3f6972de1d846020f10aa58a0deaad35;hp=6d729238a575e8ae149d85a8f25693f7a2554400;hb=783a3b9aa609d6805e1463655d25c7ae176c4859;hpb=a655f4cf59f557aef3f0a975988d87bdd3b199fd diff --git a/src/common/sessiond-comm/inet.c b/src/common/sessiond-comm/inet.c index 6d729238a..eb0c4fde3 100644 --- a/src/common/sessiond-comm/inet.c +++ b/src/common/sessiond-comm/inet.c @@ -57,6 +57,7 @@ LTTNG_HIDDEN int lttcomm_create_inet_sock(struct lttcomm_sock *sock, int type, int proto) { int val = 1, ret; + unsigned long timeout; /* Create server socket */ if ((sock->fd = socket(PF_INET, type, proto)) < 0) { @@ -74,6 +75,17 @@ int lttcomm_create_inet_sock(struct lttcomm_sock *sock, int type, int proto) PERROR("setsockopt inet"); goto error; } + timeout = lttcomm_get_network_timeout(); + if (timeout) { + ret = lttcomm_setsockopt_rcv_timeout(sock->fd, timeout); + if (ret) { + goto error; + } + ret = lttcomm_setsockopt_snd_timeout(sock->fd, timeout); + if (ret) { + goto error; + } + } return 0;