aboutsummaryrefslogtreecommitdiffstats
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-09 14:07:25 -0200
commitbf5a35cee908eca27d0039b6bac5670039a1365c (patch)
tree547d5d08cd62156c408384538dac2bb6f4b62adb
parentecore_con_server_example: add tcp+ssl, upgrades a live client. (diff)
downloadefl-bf5a35cee908eca27d0039b6bac5670039a1365c.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;