Handle a new command 20/266820/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 19 Nov 2021 04:09:28 +0000 (13:09 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 19 Nov 2021 04:09:28 +0000 (13:09 +0900)
To monitor the state of the launchpad, AMD will connect to the launchpad
and maintain the connection.

Change-Id: Ib8a9eaf30b4beaa1e40a0c46a7752c4b5e4ea86f
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad-process-pool/src/launchpad.c
src/lib/common/inc/launchpad_common.h

index 516079c3d711acacad2c9c77e0cfe9ae0631b8aa..c2690061e2432d5fb544b84f7f97d8f4db662ecb 100644 (file)
@@ -183,6 +183,7 @@ static int MAX_CPU_CHECK_COUNT;
 static io_channel_h __logger_channel;
 static io_channel_h __label_monitor_channel;
 static io_channel_h __launchpad_channel;
+static int __client_fd = -1;
 
 static candidate_process_context_t *__add_slot(int type, int loader_id,
                int caller_pid, const char *loader_name,
@@ -2224,6 +2225,14 @@ static bool __handle_launch_event(int fd, io_condition_e cond, void *data)
                close(clifd);
                clifd = -1;
                goto end;
+       case PAD_CMD_CONNECT:
+               _W("Connected. fd(%d)", clifd);
+               if (__client_fd != -1)
+                       close(__client_fd);
+
+               __client_fd = clifd;
+               clifd = -1;
+               goto end;
        }
 
        INIT_PERF(kb);
index ff257a1f757f8122b248f8264c7392ffdc28186b..a1a77847ad1c2a708cfca985a7d39ce5eea91851 100644 (file)
@@ -49,6 +49,7 @@
 #define PAD_CMD_PING           15
 #define PAD_CMD_UPDATE_APP_TYPE        16
 #define PAD_CMD_PREPARE_APP_DEFINED_LOADER     17
+#define PAD_CMD_CONNECT         18
 
 #define LAUNCHPAD_LAUNCH_SIGNAL 83
 #define LAUNCHPAD_DEAD_SIGNAL 61