projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
inet/inet6 sockets: apply timeout
[lttng-tools.git]
/
src
/
common
/
sessiond-comm
/
inet.c
diff --git
a/src/common/sessiond-comm/inet.c
b/src/common/sessiond-comm/inet.c
index 6d729238a575e8ae149d85a8f25693f7a2554400..eb0c4fde3f6972de1d846020f10aa58a0deaad35 100644
(file)
--- 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;
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) {
/* 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;
}
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;
return 0;
This page took
0.024538 seconds
and
5
git commands to generate.