inet/inet6 sockets: apply timeout
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 1d047fd85240582854f5a6c50744b23ce7ac4cb1..d22e2a63d7d5d96526a7e93b2c2761a0c0894924 100644 (file)
@@ -446,7 +446,10 @@ static void cleanup(void)
 
        DBG("Cleaning up");
 
-       /* First thing first, stop all threads */
+       /*
+        * Close the thread quit pipe. It has already done its job,
+        * since we are now called.
+        */
        utils_close_pipe(thread_quit_pipe);
 
        /*
@@ -675,6 +678,8 @@ static int update_kernel_stream(struct consumer_data *consumer_data, int fd)
                                if (ret < 0) {
                                        goto error;
                                }
+                               /* Update the stream global counter */
+                               ksess->stream_count_global += ret;
 
                                /*
                                 * Have we already sent fds to the consumer? If yes, it means
@@ -1293,11 +1298,17 @@ static void *thread_manage_apps(void *data)
                                                goto error;
                                        }
 
-                                       /* Set socket timeout for both receiving and ending */
+                                       /*
+                                        * Set socket timeout for both receiving and ending.
+                                        * app_socket_timeout is in seconds, whereas
+                                        * lttcomm_setsockopt_rcv_timeout and
+                                        * lttcomm_setsockopt_snd_timeout expect msec as
+                                        * parameter.
+                                        */
                                        (void) lttcomm_setsockopt_rcv_timeout(sock,
-                                                       app_socket_timeout);
+                                                       app_socket_timeout * 1000);
                                        (void) lttcomm_setsockopt_snd_timeout(sock,
-                                                       app_socket_timeout);
+                                                       app_socket_timeout * 1000);
 
                                        DBG("Apps with sock %d added to poll set", sock);
 
@@ -4626,6 +4637,9 @@ int main(int argc, char **argv)
 
        write_pidfile();
 
+       /* Initialize communication library */
+       lttcomm_init();
+
        /* Create thread to manage the client socket */
        ret = pthread_create(&ht_cleanup_thread, NULL,
                        thread_ht_cleanup, (void *) NULL);
This page took 0.024503 seconds and 4 git commands to generate.