\hypertarget{ecore_con_client_example_8c-example}{}\doxysection{ecore\+\_\+con\+\_\+client\+\_\+example.\+c}
Shows how to write a simple client (dialer that connects to the example server using \mbox{\hyperlink{group__Ecore__Con__Server__Group_gae3d7391f7da5e0f748d7b6804d010b2f}{ecore\+\_\+con\+\_\+server\+\_\+connect()}}.


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile with:}}
\DoxyCodeLine{\textcolor{comment}{// gcc -\/o ecore\_con\_client\_example ecore\_con\_client\_example.c `pkg-\/config -\/-\/libs -\/-\/cflags ecore ecore-\/con eina`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#ifdef HAVE\_CONFIG\_H}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include "config.h"}}
\DoxyCodeLine{\textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore\_Con.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore\_Getopt.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{/* Ecore\_Con client example}}
\DoxyCodeLine{\textcolor{comment}{ * 2010 Mike Blumenkrantz}}
\DoxyCodeLine{\textcolor{comment}{ */}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga80f90f9716013d6104624c2e606f8915}{Ecore\_Con\_Server}} *svr;}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int} retval = EXIT\_SUCCESS;}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} do\_flush = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} single\_message = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} verify = \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} hostname\_verify = \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} do\_ssl\_upgrade = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{char} *starttls\_local\_command = NULL;}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_setup\_ssl(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Eina__Iterator}{Eina\_Iterator}} *it;}
\DoxyCodeLine{   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *ca;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!(it = \mbox{\hyperlink{group__Eina__File__Group_ga8c4fabb379b865a4ec134a5c4436be2a}{eina\_file\_ls}}(\textcolor{stringliteral}{"/etc/ssl/certs"})))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        retval = EXIT\_FAILURE;}
\DoxyCodeLine{        \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* add all the CAs */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Iterator__Group_gac7314580e18868ef229f5d2814562794}{EINA\_ITERATOR\_FOREACH}}(it, ca)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Con__SSL__Group_ga48d588d6dd1fb2710c64c57d20bd795c}{ecore\_con\_ssl\_server\_cafile\_add}}(svr, ca))}
\DoxyCodeLine{          fprintf(stderr, \textcolor{stringliteral}{"WARNING: could not load CA: \%s!\(\backslash\)n"}, ca);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Stringshare__Group_ga495411b0bc85b9c0d59ec7255a025260}{eina\_stringshare\_del}}(ca);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Iterator__Group_gaf9261991a4b05dc63e3401278a3281f8}{eina\_iterator\_free}}(it);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (verify)}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Con__SSL__Group_ga72320d4fd96ea97997850d1fc32a88b7}{ecore\_con\_ssl\_server\_verify}}(svr);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (hostname\_verify)}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Con__SSL__Group_ga6ceab74f3cdf03a7485acddda01ebd17}{ecore\_con\_ssl\_server\_verify\_basic}}(svr);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_on\_stdin(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{group__Ecore__FD__Handler__Group_ga225121ed2123da4b52b76aa08d78c220}{Ecore\_Fd\_Handler}} *fdh \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{char} *line = NULL;}
\DoxyCodeLine{\textcolor{preprocessor}{\#ifdef \_WIN32}}
\DoxyCodeLine{   \textcolor{keywordtype}{char} lbuf[4096] = \textcolor{stringliteral}{""};}
\DoxyCodeLine{   ssize\_t r;}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (fgets(lbuf, \textcolor{keyword}{sizeof}(lbuf), stdin) == NULL)}
\DoxyCodeLine{     r = -\/1;}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        line = strdup(lbuf);}
\DoxyCodeLine{        r = strlen(line);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{\textcolor{preprocessor}{\#else}}
\DoxyCodeLine{   \textcolor{keywordtype}{size\_t} len = 0;}
\DoxyCodeLine{   ssize\_t r = getline(\&line, \&len, stdin);}
\DoxyCodeLine{\textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (r < 0)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        fprintf(stderr, \textcolor{stringliteral}{"ERROR: could not read from stdin: \%s\(\backslash\)n"}, strerror(errno));}
\DoxyCodeLine{        \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gae0c653baad8836232c0dc27f91f875d6}{ECORE\_CALLBACK\_CANCEL}};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!svr)}
\DoxyCodeLine{     fputs(\textcolor{stringliteral}{"WARNING: not connected to server, ignored input.\(\backslash\)n"}, stderr);}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \textcolor{keywordtype}{size\_t} clen = strlen(starttls\_local\_command);}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (do\_ssl\_upgrade \&\& ((\textcolor{keywordtype}{size\_t})r > clen) \&\&}
\DoxyCodeLine{            (strncmp(line, starttls\_local\_command, clen) == 0) \&\&}
\DoxyCodeLine{            (line[clen] == \textcolor{charliteral}{'\(\backslash\)n'} || line[clen] == \textcolor{charliteral}{'\(\backslash\)r'}))}
\DoxyCodeLine{          \{}
\DoxyCodeLine{             printf(\textcolor{stringliteral}{"INFO: starting SSL communication...\(\backslash\)n"});}
\DoxyCodeLine{}
\DoxyCodeLine{             \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Con__SSL__Group_gaa48f98d4fd439d1bb8dc00cb91e897a5}{ecore\_con\_ssl\_server\_upgrade}}(svr, ECORE\_CON\_USE\_MIXED | ECORE\_CON\_LOAD\_CERT))}
\DoxyCodeLine{               \{}
\DoxyCodeLine{                  printf(\textcolor{stringliteral}{"ERROR: failed to upgrade to SSL!\(\backslash\)n"});}
\DoxyCodeLine{                  retval = EXIT\_FAILURE;}
\DoxyCodeLine{                  \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga79c76b9f725ceda216e9c7e5caf6cbd9}{ecore\_con\_server\_del}}(svr);}
\DoxyCodeLine{                  \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{               \}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#if 1}}
\DoxyCodeLine{             \textcolor{comment}{/* This just works since EFL v 1.19.  Prior to this,}}
\DoxyCodeLine{\textcolor{comment}{              * upgrade couldn't get any extra setup, such as}}
\DoxyCodeLine{\textcolor{comment}{              * certificate or verification mode as OpenSSL would}}
\DoxyCodeLine{\textcolor{comment}{              * complain.}}
\DoxyCodeLine{\textcolor{comment}{              */}}
\DoxyCodeLine{             \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!\_setup\_ssl())}
\DoxyCodeLine{               \{}
\DoxyCodeLine{                  retval = EXIT\_FAILURE;}
\DoxyCodeLine{                  \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga79c76b9f725ceda216e9c7e5caf6cbd9}{ecore\_con\_server\_del}}(svr);}
\DoxyCodeLine{                  \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{               \}}
\DoxyCodeLine{\textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{}
\DoxyCodeLine{             svr = NULL; \textcolor{comment}{/* it's considered dead until ECORE\_CON\_EVENT\_SERVER\_UPGRADE */}}
\DoxyCodeLine{             \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{          \}}
\DoxyCodeLine{        \mbox{\hyperlink{group__Ecore__Con__Server__Group_gadf16abc2d4fc16a8b65709eab2cd8337}{ecore\_con\_server\_send}}(svr, line, r);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"INFO: sent \%zd bytes to server.\(\backslash\)n"}, r);}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (do\_flush) \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga3ddb6c88484b59a1f5a5bacb8b6e60fe}{ecore\_con\_server\_flush}}(svr);}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (single\_message)}
\DoxyCodeLine{          \{}
\DoxyCodeLine{             \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga79c76b9f725ceda216e9c7e5caf6cbd9}{ecore\_con\_server\_del}}(svr);}
\DoxyCodeLine{             svr = NULL;}
\DoxyCodeLine{             \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{          \}}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{ end:}
\DoxyCodeLine{   free(line);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_add(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{int} type \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{struct__Ecore__Con__Event__Server__Add}{Ecore\_Con\_Event\_Server\_Add}} *ev)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Server with ip \%s connected!\(\backslash\)n"}, \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga03369030d39ae060350751abd6833c11}{ecore\_con\_server\_ip\_get}}(ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Add_a382a9545ed7fb941a30dc4d598dc7e4d}{server}}));}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (do\_ssl\_upgrade)}
\DoxyCodeLine{     printf(\textcolor{stringliteral}{"INFO: Not sending 'hello!' in tcp+ssl mode. Use: \%s to upgrade the connection\(\backslash\)n"}, starttls\_local\_command);}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Con__Server__Group_gadf16abc2d4fc16a8b65709eab2cd8337}{ecore\_con\_server\_send}}(ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Add_a382a9545ed7fb941a30dc4d598dc7e4d}{server}}, \textcolor{stringliteral}{"hello!"}, strlen(\textcolor{stringliteral}{"hello!"}));}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (do\_flush) \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga3ddb6c88484b59a1f5a5bacb8b6e60fe}{ecore\_con\_server\_flush}}(ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Add_a382a9545ed7fb941a30dc4d598dc7e4d}{server}});}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_del(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{int} type \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{struct__Ecore__Con__Event__Server__Del}{Ecore\_Con\_Event\_Server\_Del}} *ev)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Lost server with ip \%s!\(\backslash\)n"}, \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga03369030d39ae060350751abd6833c11}{ecore\_con\_server\_ip\_get}}(ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Del_a116963b404600e7154c61f94ebf52a2e}{server}}));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga79c76b9f725ceda216e9c7e5caf6cbd9}{ecore\_con\_server\_del}}(svr);}
\DoxyCodeLine{   svr = NULL;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_data(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{int} type \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{struct__Ecore__Con__Event__Server__Data}{Ecore\_Con\_Event\_Server\_Data}} *ev)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Received \%i bytes from server:\(\backslash\)n"}}
\DoxyCodeLine{          \textcolor{stringliteral}{">>>>>\(\backslash\)n"}}
\DoxyCodeLine{          \textcolor{stringliteral}{"\%.*s\(\backslash\)n"}}
\DoxyCodeLine{          \textcolor{stringliteral}{">>>>>\(\backslash\)n"},}
\DoxyCodeLine{          ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Data_a41877d1f1cb9792508b9b1d89d53bec2}{size}},}
\DoxyCodeLine{          ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Data_a41877d1f1cb9792508b9b1d89d53bec2}{size}}, (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Data_a8d45b6d75c55b26771d241211a0d7e7e}{data}});}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_write\_(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{int} type \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{struct__Ecore__Con__Event__Server__Write}{Ecore\_Con\_Event\_Server\_Write}} *ev)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Sent \%d bytes to server\(\backslash\)n"}, ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Write_ab6851a4fc081e2c0c6916742427cdab7}{size}});}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_error(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{int} type \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{struct__Ecore__Con__Event__Server__Error}{Ecore\_Con\_Event\_Server\_Error}} *ev)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Server Error: \%s\(\backslash\)n"}, ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Error_a716e87090f7ec3ef8b7aab9d1ca0c047}{error}});}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_upgrade(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{int} type \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{struct__Ecore__Con__Event__Server__Upgrade}{Ecore\_Con\_Event\_Server\_Upgrade}} *ev)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"Server upgraded to SSL \%p \%s\(\backslash\)n"}, ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Upgrade_a551692c9afdd9a3b3020b519069e36f3}{server}}, \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga03369030d39ae060350751abd6833c11}{ecore\_con\_server\_ip\_get}}(ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Upgrade_a551692c9afdd9a3b3020b519069e36f3}{server}}));}
\DoxyCodeLine{   svr = ev-\/>\mbox{\hyperlink{struct__Ecore__Con__Event__Server__Upgrade_a551692c9afdd9a3b3020b519069e36f3}{server}};}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *types\_strs[] = \{}
\DoxyCodeLine{  \textcolor{stringliteral}{"tcp"},}
\DoxyCodeLine{  \textcolor{stringliteral}{"udp"},}
\DoxyCodeLine{  \textcolor{stringliteral}{"ssl"},}
\DoxyCodeLine{  \textcolor{stringliteral}{"tcp+ssl"},}
\DoxyCodeLine{  \textcolor{stringliteral}{"local-\/user"},}
\DoxyCodeLine{  \textcolor{stringliteral}{"local-\/system"},}
\DoxyCodeLine{  NULL}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{struct__Ecore__Getopt}{Ecore\_Getopt}} options = \{}
\DoxyCodeLine{  \textcolor{stringliteral}{"ecore\_con\_client\_example"}, \textcolor{comment}{/* program name */}}
\DoxyCodeLine{  NULL, \textcolor{comment}{/* usage line */}}
\DoxyCodeLine{  \textcolor{stringliteral}{"1"}, \textcolor{comment}{/* version */}}
\DoxyCodeLine{  \textcolor{stringliteral}{"(C) 2016 Enlightenment Project; 2010 Mike Blumenkrantz"}, \textcolor{comment}{/* copyright */}}
\DoxyCodeLine{  \textcolor{stringliteral}{"BSD 2-\/Clause"}, \textcolor{comment}{/* license */}}
\DoxyCodeLine{  \textcolor{comment}{/* long description, may be multiline and contain \(\backslash\)n */}}
\DoxyCodeLine{  \textcolor{stringliteral}{"Example of ecore\_con\_server\_connect()\(\backslash\)n"},}
\DoxyCodeLine{  \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}},}
\DoxyCodeLine{  \{}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_ga0bceaa55f928e281a24be27089d4b8d6}{ECORE\_GETOPT\_CHOICE}}(\textcolor{charliteral}{'t'}, \textcolor{stringliteral}{"type"}, \textcolor{stringliteral}{"Server type to use, defaults to 'tcp'"}, types\_strs),}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_gad2ae11581fad6e818ed8bfe1a31d5635}{ECORE\_GETOPT\_STORE\_TRUE}}(\textcolor{charliteral}{'P'}, \textcolor{stringliteral}{"no-\/proxy"}, \textcolor{stringliteral}{"Do not use SOCKS proxy for remote connections."}),}
\DoxyCodeLine{}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_gad2ae11581fad6e818ed8bfe1a31d5635}{ECORE\_GETOPT\_STORE\_TRUE}}(\textcolor{charliteral}{'f'}, \textcolor{stringliteral}{"flush"}, \textcolor{stringliteral}{"Force a flush after every send call."}),}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_gad2ae11581fad6e818ed8bfe1a31d5635}{ECORE\_GETOPT\_STORE\_TRUE}}(\textcolor{charliteral}{'m'}, \textcolor{stringliteral}{"single-\/message"}, \textcolor{stringliteral}{"Send a single message and delete the server."}),}
\DoxyCodeLine{}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_gae6b958516c8e20f7488bac102c4309a9}{ECORE\_GETOPT\_STORE\_STR}}(\textcolor{charliteral}{'c'}, \textcolor{stringliteral}{"starttls-\/local-\/command"}, \textcolor{stringliteral}{"The string to use as a local command (it's NOT sent to remote peer) to upgrade connections when -\/t/-\/-\/type=tcp+ssl. Defaults to STARTTLS, however if you need to send that to the server, change the string with this option."}),}
\DoxyCodeLine{}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_gae0b598e4c27f72b665af7be086e2d4e6}{ECORE\_GETOPT\_STORE\_FALSE}}(0, \textcolor{stringliteral}{"no-\/verify"}, \textcolor{stringliteral}{"Do not verify server's certificate"}),}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_gae0b598e4c27f72b665af7be086e2d4e6}{ECORE\_GETOPT\_STORE\_FALSE}}(0, \textcolor{stringliteral}{"no-\/hostname-\/verify"}, \textcolor{stringliteral}{"Do not Verify server's hostname based on its certificate."}),}
\DoxyCodeLine{}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_ga87a9d063b60f7c0bd79ab3fa16bb6313}{ECORE\_GETOPT\_VERSION}}(\textcolor{charliteral}{'V'}, \textcolor{stringliteral}{"version"}),}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_gac2fdfddf0778a319aafb547b04bc93b6}{ECORE\_GETOPT\_COPYRIGHT}}(\textcolor{charliteral}{'C'}, \textcolor{stringliteral}{"copyright"}),}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_ga5a0382c58582308ff65d51c14dc1b36f}{ECORE\_GETOPT\_LICENSE}}(\textcolor{charliteral}{'L'}, \textcolor{stringliteral}{"license"}),}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_gad7e09a56d2881f22d69dff005e38b67d}{ECORE\_GETOPT\_HELP}}(\textcolor{charliteral}{'h'}, \textcolor{stringliteral}{"help"}),}
\DoxyCodeLine{}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_ga4950beb14005c6d864915646dfe28fe2}{ECORE\_GETOPT\_STORE\_METAVAR\_STR}}(0, NULL, \textcolor{stringliteral}{"The server name."}, \textcolor{stringliteral}{"name"}),}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_ga3dcc251323cdd0155b24341bf7bf1347}{ECORE\_GETOPT\_STORE\_METAVAR\_INT}}(0, NULL, \textcolor{stringliteral}{"The server port."}, \textcolor{stringliteral}{"port"}),}
\DoxyCodeLine{}
\DoxyCodeLine{    \mbox{\hyperlink{group__Ecore__Getopt__Group_gaf652ac6007cd9674df603fa3dacc59e0}{ECORE\_GETOPT\_SENTINEL}}}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} *argv[])}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{char} *name = NULL;}
\DoxyCodeLine{   \textcolor{keywordtype}{char} *type\_choice = NULL;}
\DoxyCodeLine{   Ecore\_Con\_Type type;}
\DoxyCodeLine{   \textcolor{keywordtype}{int} port = -\/1;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} no\_proxy = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} quit\_option = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{   \mbox{\hyperlink{union__Ecore__Getopt__Value}{Ecore\_Getopt\_Value}} values[] = \{}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga123b1c8494301b8f76554675e8606d94}{ECORE\_GETOPT\_VALUE\_STR}}(type\_choice),}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga832f91eecd39de313b8351305cba80d3}{ECORE\_GETOPT\_VALUE\_BOOL}}(no\_proxy),}
\DoxyCodeLine{}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga832f91eecd39de313b8351305cba80d3}{ECORE\_GETOPT\_VALUE\_BOOL}}(do\_flush),}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga832f91eecd39de313b8351305cba80d3}{ECORE\_GETOPT\_VALUE\_BOOL}}(single\_message),}
\DoxyCodeLine{}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga123b1c8494301b8f76554675e8606d94}{ECORE\_GETOPT\_VALUE\_STR}}(starttls\_local\_command),}
\DoxyCodeLine{}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga832f91eecd39de313b8351305cba80d3}{ECORE\_GETOPT\_VALUE\_BOOL}}(verify),}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga832f91eecd39de313b8351305cba80d3}{ECORE\_GETOPT\_VALUE\_BOOL}}(hostname\_verify),}
\DoxyCodeLine{}
\DoxyCodeLine{     \textcolor{comment}{/* standard block to provide version, copyright, license and help */}}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga832f91eecd39de313b8351305cba80d3}{ECORE\_GETOPT\_VALUE\_BOOL}}(quit\_option), \textcolor{comment}{/* -\/V/-\/-\/version quits */}}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga832f91eecd39de313b8351305cba80d3}{ECORE\_GETOPT\_VALUE\_BOOL}}(quit\_option), \textcolor{comment}{/* -\/C/-\/-\/copyright quits */}}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga832f91eecd39de313b8351305cba80d3}{ECORE\_GETOPT\_VALUE\_BOOL}}(quit\_option), \textcolor{comment}{/* -\/L/-\/-\/license quits */}}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga832f91eecd39de313b8351305cba80d3}{ECORE\_GETOPT\_VALUE\_BOOL}}(quit\_option), \textcolor{comment}{/* -\/h/-\/-\/help quits */}}
\DoxyCodeLine{}
\DoxyCodeLine{     \textcolor{comment}{/* positional argument */}}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga123b1c8494301b8f76554675e8606d94}{ECORE\_GETOPT\_VALUE\_STR}}(name),}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga048498f4546a0dd78c541168db62494e}{ECORE\_GETOPT\_VALUE\_INT}}(port),}
\DoxyCodeLine{}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Getopt__Group_ga0440d57be0af2a77dc5de02be19aeae2}{ECORE\_GETOPT\_VALUE\_NONE}} \textcolor{comment}{/* sentinel */}}
\DoxyCodeLine{   \};}
\DoxyCodeLine{   \textcolor{keywordtype}{int} args;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\_init}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Con__Lib__Group_gacf5ecf42c516bb9c8b6759721e9559bd}{ecore\_con\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   args = \mbox{\hyperlink{group__Ecore__Getopt__Group_gab9fb5bf2f2edd9bd3a3519faa8e3ebfa}{ecore\_getopt\_parse}}(\&options, values, argc, argv);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (args < 0)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        fputs(\textcolor{stringliteral}{"ERROR: Could not parse command line options.\(\backslash\)n"}, stderr);}
\DoxyCodeLine{        retval = EXIT\_FAILURE;}
\DoxyCodeLine{        \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (quit\_option) \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{}
\DoxyCodeLine{   args = \mbox{\hyperlink{group__Ecore__Getopt__Group_ga9870510212af9a71d94fc0f8461cff79}{ecore\_getopt\_parse\_positional}}(\&options, values, argc, argv, args);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (args < 0)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        fputs(\textcolor{stringliteral}{"ERROR: Could not parse positional arguments.\(\backslash\)n"}, stderr);}
\DoxyCodeLine{        retval = EXIT\_FAILURE;}
\DoxyCodeLine{        \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!type\_choice) type\_choice = \textcolor{stringliteral}{"tcp"};}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(type\_choice, \textcolor{stringliteral}{"tcp"}) == 0)}
\DoxyCodeLine{     type = ECORE\_CON\_REMOTE\_TCP;}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(type\_choice, \textcolor{stringliteral}{"udp"}) == 0)}
\DoxyCodeLine{     type = ECORE\_CON\_REMOTE\_UDP;}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(type\_choice, \textcolor{stringliteral}{"ssl"}) == 0)}
\DoxyCodeLine{     type = ECORE\_CON\_REMOTE\_TCP | ECORE\_CON\_USE\_MIXED | ECORE\_CON\_LOAD\_CERT;}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(type\_choice, \textcolor{stringliteral}{"tcp+ssl"}) == 0)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        type = ECORE\_CON\_REMOTE\_TCP;}
\DoxyCodeLine{        do\_ssl\_upgrade = \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(type\_choice, \textcolor{stringliteral}{"local-\/user"}) == 0)}
\DoxyCodeLine{     type = ECORE\_CON\_LOCAL\_USER;}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(type\_choice, \textcolor{stringliteral}{"local-\/system"}) == 0)}
\DoxyCodeLine{     type = ECORE\_CON\_LOCAL\_SYSTEM;}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        fprintf(stderr, \textcolor{stringliteral}{"ERROR: unsupported -\/-\/type/-\/t '\%s'\(\backslash\)n"}, type\_choice);}
\DoxyCodeLine{        retval = EXIT\_FAILURE;}
\DoxyCodeLine{        \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} ((!starttls\_local\_command) || (starttls\_local\_command[0] == \textcolor{charliteral}{'\(\backslash\)0'}))}
\DoxyCodeLine{     starttls\_local\_command = \textcolor{stringliteral}{"STARTTLS"};}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (no\_proxy) type |= ECORE\_CON\_NO\_PROXY;}
\DoxyCodeLine{}
\DoxyCodeLine{   svr = \mbox{\hyperlink{group__Ecore__Con__Server__Group_gae3d7391f7da5e0f748d7b6804d010b2f}{ecore\_con\_server\_connect}}(type, name, port, NULL);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!svr) \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(type\_choice, \textcolor{stringliteral}{"ssl"}) == 0)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (!\_setup\_ssl())}
\DoxyCodeLine{          \textcolor{keywordflow}{goto} no\_mainloop;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{/* set event handler for server connect */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}}(\mbox{\hyperlink{group__Ecore__Con__Events__Group_ga4eed60012259c24f9ac75852c5ec1950}{ECORE\_CON\_EVENT\_SERVER\_ADD}}, (\mbox{\hyperlink{group__Ecore__Event__Group_ga64b4df04cbafda481593d0bc29617c6d}{Ecore\_Event\_Handler\_Cb}})\_add, NULL);}
\DoxyCodeLine{\textcolor{comment}{/* set event handler for server disconnect */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}}(\mbox{\hyperlink{group__Ecore__Con__Events__Group_gabf1abac1d209506c2813837e36dfe37b}{ECORE\_CON\_EVENT\_SERVER\_DEL}}, (\mbox{\hyperlink{group__Ecore__Event__Group_ga64b4df04cbafda481593d0bc29617c6d}{Ecore\_Event\_Handler\_Cb}})\_del, NULL);}
\DoxyCodeLine{\textcolor{comment}{/* set event handler for receiving server data */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}}(\mbox{\hyperlink{group__Ecore__Con__Events__Group_ga4bd54e9f3c04f7d601bd15b2e109f050}{ECORE\_CON\_EVENT\_SERVER\_DATA}}, (\mbox{\hyperlink{group__Ecore__Event__Group_ga64b4df04cbafda481593d0bc29617c6d}{Ecore\_Event\_Handler\_Cb}})\_data, NULL);}
\DoxyCodeLine{\textcolor{comment}{/* set event handler that notifies of sent data */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}}(\mbox{\hyperlink{group__Ecore__Con__Events__Group_gaf2c11acc6236e8c96592c283b8bf9bba}{ECORE\_CON\_EVENT\_SERVER\_WRITE}}, (\mbox{\hyperlink{group__Ecore__Event__Group_ga64b4df04cbafda481593d0bc29617c6d}{Ecore\_Event\_Handler\_Cb}})\_write\_, NULL);}
\DoxyCodeLine{\textcolor{comment}{/* set event handler that notifies of errors */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}}(\mbox{\hyperlink{group__Ecore__Con__Events__Group_ga66525bf4b03416a77d5c25407b9f2e15}{ECORE\_CON\_EVENT\_SERVER\_ERROR}}, (\mbox{\hyperlink{group__Ecore__Event__Group_ga64b4df04cbafda481593d0bc29617c6d}{Ecore\_Event\_Handler\_Cb}})\_error, NULL);}
\DoxyCodeLine{\textcolor{comment}{/* set event handler that notifies of upgrades */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}}(\mbox{\hyperlink{group__Ecore__Con__Events__Group_ga3dd70cd0b388ac0df8f8bff5057c4f52}{ECORE\_CON\_EVENT\_SERVER\_UPGRADE}}, (\mbox{\hyperlink{group__Ecore__Event__Group_ga64b4df04cbafda481593d0bc29617c6d}{Ecore\_Event\_Handler\_Cb}})\_upgrade, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__FD__Handler__Group_ga832e68eb7f15912abeadef816bb5d2f5}{ecore\_main\_fd\_handler\_add}}(STDIN\_FILENO, \mbox{\hyperlink{group__Ecore__FD__Handler__Group_ggab5644f471dfa3bd182619601d9b60608a1699f804eccf88e7e169a4a20f1d44e7}{ECORE\_FD\_READ}}, \_on\_stdin, NULL, NULL, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{/* start client */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{ no\_mainloop:}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (svr)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Ecore__Con__Server__Group_ga79c76b9f725ceda216e9c7e5caf6cbd9}{ecore\_con\_server\_del}}(svr);}
\DoxyCodeLine{        svr = NULL;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{end:}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Con__Lib__Group_gaccfd8dd2a1187b71339b5cc39dc83938}{ecore\_con\_shutdown}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\_shutdown}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} retval;}
\DoxyCodeLine{\}}
\end{DoxyCodeInclude}
 