summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-09 14:03:34 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2016-12-10 08:44:06 -0200
commit72ad2c5eb7fbe8ceb491d1f545f82ae7cfc5457b (patch)
treed70ea5cea5c12813ab53bdc57a85cbead2d3419f
parent2fab8462ce86518331376c6b685e44946020a901 (diff)
downloadefl-72ad2c5eb7fbe8ceb491d1f545f82ae7cfc5457b.tar.gz
ecore_con_server_example: add --socket-activated
-rw-r--r--src/examples/ecore/ecore_con_server_example.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/examples/ecore/ecore_con_server_example.c b/src/examples/ecore/ecore_con_server_example.c
index 26559185d3..fed7c9c29e 100644
--- a/src/examples/ecore/ecore_con_server_example.c
+++ b/src/examples/ecore/ecore_con_server_example.c
@@ -139,6 +139,8 @@ static const Ecore_Getopt options = {
EINA_FALSE,
{
ECORE_GETOPT_CHOICE('t', "type", "Server type to use, defaults to 'tcp'", types_strs),
+ ECORE_GETOPT_STORE_TRUE(0, "socket-activated",
+ "Try to use $LISTEN_FDS from systemd, if not do a regular serve"),
ECORE_GETOPT_STORE_INT('l', "clients-limit",
"If set will limit number of clients to accept"),
@@ -170,10 +172,12 @@ main(int argc, char **argv)
char *type_choice = NULL;
int clients_limit = -1;
int port = -1;
+ Eina_Bool socket_activated = EINA_FALSE;
Eina_Bool clients_reject_excess = EINA_FALSE;
Eina_Bool quit_option = EINA_FALSE;
Ecore_Getopt_Value values[] = {
ECORE_GETOPT_VALUE_STR(type_choice),
+ ECORE_GETOPT_VALUE_BOOL(socket_activated),
ECORE_GETOPT_VALUE_INT(clients_limit),
ECORE_GETOPT_VALUE_BOOL(clients_reject_excess),
@@ -245,6 +249,8 @@ main(int argc, char **argv)
goto end;
}
+ if (socket_activated) type |= ECORE_CON_SOCKET_ACTIVATE;
+
svr = ecore_con_server_add(type, name, port, NULL);
if (!svr) goto end;