\hypertarget{group__Ecore__Con__Server__Group}{\section{Ecore Connection Server Functions}
\label{group__Ecore__Con__Server__Group}\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}}
}


This group of functions is applied to an Ecore\+\_\+\+Con\+\_\+\+Server object.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} Ecore\+\_\+\+Con\+\_\+\+Server $\ast$ \hyperlink{group__Ecore__Con__Server__Group_gaf450c4039d5e61d4f7a58d7b67efc1e8}{ecore\+\_\+con\+\_\+server\+\_\+add} (Ecore\+\_\+\+Con\+\_\+\+Type type, const char $\ast$name, int port, const void $\ast$data)
\begin{DoxyCompactList}\small\item\em Creates a server to listen for connections. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_gaf6b48cdf479e8d03f1afce61c9dd8949}{static E\+O\+L\+I\+A\+N void {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+eo\+\_\+base\+\_\+constructor} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_gaf6b48cdf479e8d03f1afce61c9dd8949}

\item 
\hypertarget{group__Ecore__Con__Server__Group_gaf83d4e8b3e338ade06fd23245fae63bd}{static E\+O\+L\+I\+A\+N \hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$ {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+eo\+\_\+base\+\_\+finalize} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_gaf83d4e8b3e338ade06fd23245fae63bd}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} Ecore\+\_\+\+Con\+\_\+\+Server $\ast$ \hyperlink{group__Ecore__Con__Server__Group_gae3d7391f7da5e0f748d7b6804d010b2f}{ecore\+\_\+con\+\_\+server\+\_\+connect} (Ecore\+\_\+\+Con\+\_\+\+Type type, const char $\ast$name, int port, const void $\ast$data)
\begin{DoxyCompactList}\small\item\em Creates a connection to the specified server and returns an associated object. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_ga213f9a22e74aeaa305d4d5512b7f6d49}{static E\+O\+L\+I\+A\+N \hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$ {\bfseries \+\_\+ecore\+\_\+con\+\_\+connector\+\_\+eo\+\_\+base\+\_\+finalize} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$obj, void $\ast$pd)}\label{group__Ecore__Con__Server__Group_ga213f9a22e74aeaa305d4d5512b7f6d49}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void \hyperlink{group__Ecore__Con__Server__Group_ga468eec82ada0234b6ea2b5b8d6e25407}{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+set} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr, double timeout)
\begin{DoxyCompactList}\small\item\em Set the default time after which an inactive client will be disconnected. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_ga079ad5f8885e641df7ba7909fde7338d}{static E\+O\+L\+I\+A\+N void {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+ecore\+\_\+con\+\_\+base\+\_\+timeout\+\_\+set} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr, double timeout)}\label{group__Ecore__Con__Server__Group_ga079ad5f8885e641df7ba7909fde7338d}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} double \hyperlink{group__Ecore__Con__Server__Group_ga50906ed9ec7845aa3bfe21998b646345}{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+get} (const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr)
\begin{DoxyCompactList}\small\item\em Get the default time after which an inactive client will be disconnected. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_ga4907662f52e401b071019c215f3bfb02}{static E\+O\+L\+I\+A\+N double {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+ecore\+\_\+con\+\_\+base\+\_\+timeout\+\_\+get} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_ga4907662f52e401b071019c215f3bfb02}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void $\ast$ \hyperlink{group__Ecore__Con__Server__Group_ga79c76b9f725ceda216e9c7e5caf6cbd9}{ecore\+\_\+con\+\_\+server\+\_\+del} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr)
\begin{DoxyCompactList}\small\item\em Closes the connection and frees the given server. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void $\ast$ \hyperlink{group__Ecore__Con__Server__Group_ga0a03ab73a105ad9a17265966f5683625}{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr)
\begin{DoxyCompactList}\small\item\em Retrieves the data associated with the given server. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void $\ast$ \hyperlink{group__Ecore__Con__Server__Group_ga09ee7d7908fb1588740b19ba22d7c29d}{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr, void $\ast$data)
\begin{DoxyCompactList}\small\item\em Sets the data associated with the given server. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Ecore__Con__Server__Group_ga68bd9a81d91669aa6c85e41460acb100}{ecore\+\_\+con\+\_\+server\+\_\+connected\+\_\+get} (const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr)
\begin{DoxyCompactList}\small\item\em Retrieves whether the given server is currently connected. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_ga236f57964409f96b1b0093417e476901}{static E\+O\+L\+I\+A\+N \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+ecore\+\_\+con\+\_\+base\+\_\+connected\+\_\+get} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_ga236f57964409f96b1b0093417e476901}

\item 
\hypertarget{group__Ecore__Con__Server__Group_gaf079257119b0ab81689b62877f5b9aa8}{E\+O\+L\+I\+A\+N const \hyperlink{group__Eina__List__Group_ga3295e1210efea1fb0fd6acbf3cbc1f29}{Eina\+\_\+\+List} $\ast$ {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+clients\+\_\+get} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_gaf079257119b0ab81689b62877f5b9aa8}

\item 
\hypertarget{group__Ecore__Con__Server__Group_ga3700bd2721ff68d6c7d07ca0dfe993da}{static E\+O\+L\+I\+A\+N void {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+connection\+\_\+type\+\_\+set} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr, Ecore\+\_\+\+Con\+\_\+\+Type type)}\label{group__Ecore__Con__Server__Group_ga3700bd2721ff68d6c7d07ca0dfe993da}

\item 
\hypertarget{group__Ecore__Con__Server__Group_ga41040da16c57ea8659628d420f3f4a64}{static E\+O\+L\+I\+A\+N Ecore\+\_\+\+Con\+\_\+\+Type {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+connection\+\_\+type\+\_\+get} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_ga41040da16c57ea8659628d420f3f4a64}

\item 
\hypertarget{group__Ecore__Con__Server__Group_gae5c4b21e4e3f9142df0aad1ee6b60782}{static E\+O\+L\+I\+A\+N void {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+name\+\_\+set} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr, const char $\ast$name)}\label{group__Ecore__Con__Server__Group_gae5c4b21e4e3f9142df0aad1ee6b60782}

\item 
\hypertarget{group__Ecore__Con__Server__Group_gae1bb3f4e52b09f32fb310fa1e997c7c5}{static E\+O\+L\+I\+A\+N const char $\ast$ {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+name\+\_\+get} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_gae1bb3f4e52b09f32fb310fa1e997c7c5}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Ecore__Con__Server__Group_gac21ef0f2db46b32042160b83534138f9}{ecore\+\_\+con\+\_\+server\+\_\+port\+\_\+get} (const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr)
\begin{DoxyCompactList}\small\item\em Retrieves the server port in use. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_ga4b938c65ad5e53613d905e39f31d40bd}{static E\+O\+L\+I\+A\+N void {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+ecore\+\_\+con\+\_\+base\+\_\+port\+\_\+set} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr, int port)}\label{group__Ecore__Con__Server__Group_ga4b938c65ad5e53613d905e39f31d40bd}

\item 
\hypertarget{group__Ecore__Con__Server__Group_gad8df57e76272fca970513c96a76dcf49}{static E\+O\+L\+I\+A\+N int {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+ecore\+\_\+con\+\_\+base\+\_\+port\+\_\+get} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_gad8df57e76272fca970513c96a76dcf49}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Ecore__Con__Server__Group_gadf16abc2d4fc16a8b65709eab2cd8337}{ecore\+\_\+con\+\_\+server\+\_\+send} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr, const void $\ast$data, int size)
\begin{DoxyCompactList}\small\item\em Sends the given data to the given server. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_gaeefd7d6dc5f2afed5bcabe8fd7d20021}{static E\+O\+L\+I\+A\+N int {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+ecore\+\_\+con\+\_\+base\+\_\+send} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr, const void $\ast$data, int size)}\label{group__Ecore__Con__Server__Group_gaeefd7d6dc5f2afed5bcabe8fd7d20021}

\item 
\hypertarget{group__Ecore__Con__Server__Group_gaffda35fb64c7db65eda1b4acd459b06c}{static E\+O\+L\+I\+A\+N void {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+client\+\_\+limit\+\_\+set} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr, int client\+\_\+limit, char reject\+\_\+excess\+\_\+clients)}\label{group__Ecore__Con__Server__Group_gaffda35fb64c7db65eda1b4acd459b06c}

\item 
\hypertarget{group__Ecore__Con__Server__Group_gac9c065d435ea2c7f2e7893019c347e92}{static E\+O\+L\+I\+A\+N void {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+client\+\_\+limit\+\_\+get} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr, int $\ast$client\+\_\+limit, char $\ast$reject\+\_\+excess\+\_\+clients)}\label{group__Ecore__Con__Server__Group_gac9c065d435ea2c7f2e7893019c347e92}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} const char $\ast$ \hyperlink{group__Ecore__Con__Server__Group_gaea2a907ae4ca478a360928fd16654d45}{ecore\+\_\+con\+\_\+server\+\_\+ip\+\_\+get} (const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr)
\begin{DoxyCompactList}\small\item\em Gets the I\+P address of a server that has been connected to. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_ga48139e1db660f94abc5c58ef875fda47}{static E\+O\+L\+I\+A\+N const char $\ast$ {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+ecore\+\_\+con\+\_\+base\+\_\+ip\+\_\+get} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_ga48139e1db660f94abc5c58ef875fda47}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} double \hyperlink{group__Ecore__Con__Server__Group_ga1f7c1040e60e9e9a53a9a01f70aa52b3}{ecore\+\_\+con\+\_\+server\+\_\+uptime\+\_\+get} (const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr)
\begin{DoxyCompactList}\small\item\em Check how long a server has been connected. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_ga8e9331d6c91ddce038ee7326b93d2536}{static E\+O\+L\+I\+A\+N double {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+ecore\+\_\+con\+\_\+base\+\_\+uptime\+\_\+get} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_ga8e9331d6c91ddce038ee7326b93d2536}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void \hyperlink{group__Ecore__Con__Server__Group_ga3ddb6c88484b59a1f5a5bacb8b6e60fe}{ecore\+\_\+con\+\_\+server\+\_\+flush} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr)
\begin{DoxyCompactList}\small\item\em Flushes all pending data to the given server. \end{DoxyCompactList}\item 
\hypertarget{group__Ecore__Con__Server__Group_ga59370dd666feb4cb5c48bc20d62fd21c}{static E\+O\+L\+I\+A\+N void {\bfseries \+\_\+ecore\+\_\+con\+\_\+server\+\_\+ecore\+\_\+con\+\_\+base\+\_\+flush} (\hyperlink{group__Eo_ga9f3010a50b61a892d41f4ec2bda73f4c}{Eo} $\ast$obj, Ecore\+\_\+\+Con\+\_\+\+Server\+\_\+\+Data $\ast$svr)}\label{group__Ecore__Con__Server__Group_ga59370dd666feb4cb5c48bc20d62fd21c}

\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} void \hyperlink{group__Ecore__Con__Server__Group_gabaef36c991be8922766611c75372ced4}{ecore\+\_\+con\+\_\+server\+\_\+client\+\_\+limit\+\_\+set} (Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr, int client\+\_\+limit, char reject\+\_\+excess\+\_\+clients)
\begin{DoxyCompactList}\small\item\em Sets a limit on the number of clients that can be handled concurrently by the given server, and a policy on what to do if excess clients try to connect. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Ecore__Con__Server__Group_ga1a97c1a6eafdf856643b586729de00b5}{ecore\+\_\+con\+\_\+server\+\_\+fd\+\_\+get} (const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$svr)
\begin{DoxyCompactList}\small\item\em Get the fd that the server is connected to. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+P\+I} int \hyperlink{group__Ecore__Con__Server__Group_ga43decb7ba52a2b14cfa563b60659491c}{ecore\+\_\+con\+\_\+client\+\_\+fd\+\_\+get} (const Ecore\+\_\+\+Con\+\_\+\+Client $\ast$cl)
\begin{DoxyCompactList}\small\item\em Get the fd that the client is connected to. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This group of functions is applied to an Ecore\+\_\+\+Con\+\_\+\+Server object. 

Functions that operate on Ecore server objects.

It doesn't mean that they should be used in the server application, but on the server object. In fact, most of them should be used in the client application, when retrieving information or sending data.

Setting up a server is very simple\+: you just need to start it with \hyperlink{group__Ecore__Con__Server__Group_gaf450c4039d5e61d4f7a58d7b67efc1e8}{ecore\+\_\+con\+\_\+server\+\_\+add()} and setup some callbacks to the events \hyperlink{group__Ecore__Con__Events__Group_ga2ccb9d84c4e5480a787e4672af3e353f}{E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+E\+V\+E\+N\+T\+\_\+\+C\+L\+I\+E\+N\+T\+\_\+\+A\+D\+D}, \hyperlink{group__Ecore__Con__Events__Group_ga0daddd73ab2ab92cbfd91f50ea344e12}{E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+E\+V\+E\+N\+T\+\_\+\+C\+L\+I\+E\+N\+T\+\_\+\+D\+E\+L} and \hyperlink{group__Ecore__Con__Events__Group_gafb9ce301001338915a45969e4d11d016}{E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+E\+V\+E\+N\+T\+\_\+\+C\+L\+I\+E\+N\+T\+\_\+\+D\+A\+T\+A}, that will be called when a client is communicating with the server\+:


\begin{DoxyCode}
\textcolor{keywordflow}{if} (!(svr = \hyperlink{group__Ecore__Con__Server__Group_gaf450c4039d5e61d4f7a58d7b67efc1e8}{ecore\_con\_server\_add}(\hyperlink{group__Ecore__Con__Lib__Group_gga4862bfa05383e6e16a1dfc6eafc90564ab02a4b8522d1ed409cfb24131b24c4ed}{ECORE\_CON\_REMOTE\_TCP}, \textcolor{stringliteral}{"127.0.0.1"},
       8080, NULL)))
  exit(1);

\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}(\hyperlink{group__Ecore__Con__Events__Group_ga2ccb9d84c4e5480a787e4672af3e353f}{ECORE\_CON\_EVENT\_CLIENT\_ADD}, 
      \_add\_cb, NULL);
\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}(\hyperlink{group__Ecore__Con__Events__Group_ga0daddd73ab2ab92cbfd91f50ea344e12}{ECORE\_CON\_EVENT\_CLIENT\_DEL}, 
      \_del\_cb, NULL);
\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}(\hyperlink{group__Ecore__Con__Events__Group_gafb9ce301001338915a45969e4d11d016}{ECORE\_CON\_EVENT\_CLIENT\_DATA}, 
      \_data\_cb, NULL);

\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}();
\end{DoxyCode}


The function \hyperlink{group__Ecore__Con__Server__Group_gae3d7391f7da5e0f748d7b6804d010b2f}{ecore\+\_\+con\+\_\+server\+\_\+connect()} can be used to write a client that connects to a server. The resulting code will be very similar to the server code\+:


\begin{DoxyCode}
\textcolor{keywordflow}{if} (!(svr = \hyperlink{group__Ecore__Con__Server__Group_gae3d7391f7da5e0f748d7b6804d010b2f}{ecore\_con\_server\_connect}(
      \hyperlink{group__Ecore__Con__Lib__Group_gga4862bfa05383e6e16a1dfc6eafc90564ab02a4b8522d1ed409cfb24131b24c4ed}{ECORE\_CON\_REMOTE\_TCP}, \textcolor{stringliteral}{"127.0.0.1"}, 8080, NULL)))
  exit(1);

\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}(\hyperlink{group__Ecore__Con__Events__Group_ga4eed60012259c24f9ac75852c5ec1950}{ECORE\_CON\_EVENT\_SERVER\_ADD}, 
      \_add\_cb, NULL);
\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}(\hyperlink{group__Ecore__Con__Events__Group_gabf1abac1d209506c2813837e36dfe37b}{ECORE\_CON\_EVENT\_SERVER\_DEL}, 
      \_del\_cb, NULL);
\hyperlink{group__Ecore__Event__Group_gae75b0b1b2c50e73b8e42afc628b00a62}{ecore\_event\_handler\_add}(\hyperlink{group__Ecore__Con__Events__Group_ga4bd54e9f3c04f7d601bd15b2e109f050}{ECORE\_CON\_EVENT\_SERVER\_DATA}, 
      \_data\_cb, NULL);

\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}();
\end{DoxyCode}


After these two pieces of code are executed, respectively, in the server and client code, the server will be up and running and the client will try to connect to it. The connection, with its subsequent messages being sent from server to client and client to server, can be represented in the following sequence diagram\+:



 
\begin{DoxyImage}
\includegraphics{ecore_con-client-server}
\caption{width=}
\end{DoxyImage}


Please notice the important difference between these two codes\+: the first is used for writing a {\bfseries server}, while the second should be used for writing a {\bfseries client}.

A reference for the {\ttfamily client} functions can be found at \hyperlink{group__Ecore__Con__Client__Group}{Ecore Connection Client Functions}.

Examples of usage for this A\+P\+I can be found here\+: \begin{DoxyItemize}
\item \hyperlink{ecore_con_server_simple_example_c}{Ecore\+\_\+\+Con -\/ Creating a server} \item \hyperlink{ecore_con_client_simple_example_c}{Ecore\+\_\+\+Con -\/ Creating a client} \end{DoxyItemize}


\subsection{Function Documentation}
\hypertarget{group__Ecore__Con__Server__Group_gaf450c4039d5e61d4f7a58d7b67efc1e8}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+add@{ecore\+\_\+con\+\_\+server\+\_\+add}}
\index{ecore\+\_\+con\+\_\+server\+\_\+add@{ecore\+\_\+con\+\_\+server\+\_\+add}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+add}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} Ecore\+\_\+\+Con\+\_\+\+Server $\ast$ ecore\+\_\+con\+\_\+server\+\_\+add (
\begin{DoxyParamCaption}
\item[{Ecore\+\_\+\+Con\+\_\+\+Type}]{type, }
\item[{const char $\ast$}]{name, }
\item[{int}]{port, }
\item[{const void $\ast$}]{data}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_gaf450c4039d5e61d4f7a58d7b67efc1e8}


Creates a server to listen for connections. 


\begin{DoxyParams}{Parameters}
{\em type} & The connection type. \\
\hline
{\em name} & Name to associate with the socket. It is used when generating the socket name of a Unix socket, or for determining what host to listen on for T\+C\+P sockets. {\ttfamily N\+U\+L\+L} will not be accepted. \\
\hline
{\em port} & Number to identify socket. When a Unix socket is used, it becomes part of the socket name. When a T\+C\+P socket is used, it is used as the T\+C\+P port. \\
\hline
{\em data} & Data to associate with the created Ecore\+\_\+\+Con\+\_\+\+Server object. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A new Ecore\+\_\+\+Con\+\_\+\+Server.
\end{DoxyReturn}
The socket on which the server listens depends on the connection type\+: \begin{DoxyItemize}
\item If {\itshape type} is {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+L\+O\+C\+A\+L\+\_\+\+U\+S\+E\+R}, the server will listen on the Unix socket \char`\"{}$\sim$/.\+ecore/\mbox{[}name\mbox{]}/\mbox{[}port\mbox{]}\char`\"{}. \item If {\itshape type} is {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+L\+O\+C\+A\+L\+\_\+\+S\+Y\+S\+T\+E\+M}, the server will listen on Unix socket \char`\"{}/tmp/.\+ecore\+\_\+service$\vert$\mbox{[}name\mbox{]}$\vert$\mbox{[}port\mbox{]}\char`\"{}. \item If {\itshape type} is {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+R\+E\+M\+O\+T\+E\+\_\+\+T\+C\+P}, the server will listen on T\+C\+P port {\ttfamily port}.\end{DoxyItemize}
More information about the {\ttfamily type} can be found at \hyperlink{group__Ecore__Con__Lib__Group_ga4862bfa05383e6e16a1dfc6eafc90564}{\+\_\+\+Ecore\+\_\+\+Con\+\_\+\+Type}.

The {\ttfamily data} parameter can be fetched later using \hyperlink{group__Ecore__Con__Server__Group_ga0a03ab73a105ad9a17265966f5683625}{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get()} or changed with \hyperlink{group__Ecore__Con__Server__Group_ga09ee7d7908fb1588740b19ba22d7c29d}{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set()}. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_server_example_8c-example}{ecore\+\_\+con\+\_\+server\+\_\+example.\+c}, and \hyperlink{ecore_con_server_simple_example_8c-example}{ecore\+\_\+con\+\_\+server\+\_\+simple\+\_\+example.\+c}.\end{Desc}


References ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set().



Referenced by ecore\+\_\+ipc\+\_\+server\+\_\+add().

\hypertarget{group__Ecore__Con__Server__Group_gae3d7391f7da5e0f748d7b6804d010b2f}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+connect@{ecore\+\_\+con\+\_\+server\+\_\+connect}}
\index{ecore\+\_\+con\+\_\+server\+\_\+connect@{ecore\+\_\+con\+\_\+server\+\_\+connect}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+connect}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} Ecore\+\_\+\+Con\+\_\+\+Server $\ast$ ecore\+\_\+con\+\_\+server\+\_\+connect (
\begin{DoxyParamCaption}
\item[{Ecore\+\_\+\+Con\+\_\+\+Type}]{type, }
\item[{const char $\ast$}]{name, }
\item[{int}]{port, }
\item[{const void $\ast$}]{data}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_gae3d7391f7da5e0f748d7b6804d010b2f}


Creates a connection to the specified server and returns an associated object. 


\begin{DoxyParams}{Parameters}
{\em type} & The connection type. \\
\hline
{\em name} & Name used when determining what socket to connect to. It is used to generate the socket name when the socket is a Unix socket. It is used as the hostname when connecting with a T\+C\+P socket. \\
\hline
{\em port} & Number to identify the socket to connect to. Used when generating the socket name for a Unix socket, or as the T\+C\+P port when connecting to a T\+C\+P socket. \\
\hline
{\em data} & Data to associate with the created Ecore\+\_\+\+Con\+\_\+\+Server object. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A new Ecore\+\_\+\+Con\+\_\+\+Server.
\end{DoxyReturn}
The socket to which the connection is made depends on the connection type\+: \begin{DoxyItemize}
\item If {\itshape type} is {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+L\+O\+C\+A\+L\+\_\+\+U\+S\+E\+R}, the function will connect to the server at the Unix socket \char`\"{}$\sim$/.\+ecore/\mbox{[}name\mbox{]}/\mbox{[}port\mbox{]}\char`\"{}. \item If {\itshape type} is {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+L\+O\+C\+A\+L\+\_\+\+S\+Y\+S\+T\+E\+M}, the function will connect to the server at the Unix socket \char`\"{}/tmp/.\+ecore\+\_\+service$\vert$\mbox{[}name\mbox{]}$\vert$\mbox{[}port\mbox{]}\char`\"{}. \item If {\itshape type} is {\ttfamily E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+R\+E\+M\+O\+T\+E\+\_\+\+T\+C\+P}, the function will connect to the server at the T\+C\+P port \char`\"{}\mbox{[}name\mbox{]}\+:\mbox{[}port\mbox{]}\char`\"{}.\end{DoxyItemize}
More information about the {\ttfamily type} can be found at \hyperlink{group__Ecore__Con__Lib__Group_ga4862bfa05383e6e16a1dfc6eafc90564}{\+\_\+\+Ecore\+\_\+\+Con\+\_\+\+Type}.

This function won't block. It will either succeed, or fail due to invalid parameters, failed memory allocation, etc., returning {\ttfamily N\+U\+L\+L} on that case.

However, even if this call returns a valid Ecore\+\_\+\+Con\+\_\+\+Server, the connection will only be successfully completed if an event of type \hyperlink{group__Ecore__Con__Events__Group_ga4eed60012259c24f9ac75852c5ec1950}{E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+E\+V\+E\+N\+T\+\_\+\+S\+E\+R\+V\+E\+R\+\_\+\+A\+D\+D} is received. If it fails to complete, an \hyperlink{group__Ecore__Con__Events__Group_gabf1abac1d209506c2813837e36dfe37b}{E\+C\+O\+R\+E\+\_\+\+C\+O\+N\+\_\+\+E\+V\+E\+N\+T\+\_\+\+S\+E\+R\+V\+E\+R\+\_\+\+D\+E\+L} will be received.

The {\ttfamily data} parameter can be fetched later using \hyperlink{group__Ecore__Con__Server__Group_ga0a03ab73a105ad9a17265966f5683625}{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get()} or changed with \hyperlink{group__Ecore__Con__Server__Group_ga09ee7d7908fb1588740b19ba22d7c29d}{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set()}. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_client_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+example.\+c}, and \hyperlink{ecore_con_client_simple_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+simple\+\_\+example.\+c}.\end{Desc}


References ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set().



Referenced by ecore\+\_\+ipc\+\_\+server\+\_\+connect().

\hypertarget{group__Ecore__Con__Server__Group_ga468eec82ada0234b6ea2b5b8d6e25407}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+set@{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+set}}
\index{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+set@{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+set}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+set}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+set (
\begin{DoxyParamCaption}
\item[{Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr, }
\item[{double}]{timeout}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga468eec82ada0234b6ea2b5b8d6e25407}


Set the default time after which an inactive client will be disconnected. 


\begin{DoxyParams}{Parameters}
{\em svr} & The server object \\
\hline
{\em timeout} & The timeout, in seconds, to disconnect after\\
\hline
\end{DoxyParams}
This function is used by the server to set the default idle timeout on clients. If the any of the clients becomes idle for a time higher than this value, it will be disconnected. A value of $<$ 1 disables the idle timeout.

This timeout is not affected by the one set by \hyperlink{group__Ecore__Con__Client__Group_gac96c76af4f6c9d842e52ea38312c73dd}{ecore\+\_\+con\+\_\+client\+\_\+timeout\+\_\+set()}. A client will be disconnected whenever the client or the server timeout is reached. That means, the lower timeout value will be used for that client if \hyperlink{group__Ecore__Con__Client__Group_gac96c76af4f6c9d842e52ea38312c73dd}{ecore\+\_\+con\+\_\+client\+\_\+timeout\+\_\+set()} is used on it.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Ecore__Con__Server__Group_ga50906ed9ec7845aa3bfe21998b646345}{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+get()} 

\hyperlink{group__Ecore__Con__Client__Group_gac96c76af4f6c9d842e52ea38312c73dd}{ecore\+\_\+con\+\_\+client\+\_\+timeout\+\_\+set()} 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_server_simple_example_8c-example}{ecore\+\_\+con\+\_\+server\+\_\+simple\+\_\+example.\+c}.\end{Desc}
\hypertarget{group__Ecore__Con__Server__Group_ga50906ed9ec7845aa3bfe21998b646345}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+get}}
\index{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+get}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} double ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga50906ed9ec7845aa3bfe21998b646345}


Get the default time after which an inactive client will be disconnected. 


\begin{DoxyParams}{Parameters}
{\em svr} & The server object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The timeout, in seconds, to disconnect after
\end{DoxyReturn}
This function is used to get the idle timeout for clients. A value of $<$ 1 means the idle timeout is disabled.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Ecore__Con__Server__Group_ga468eec82ada0234b6ea2b5b8d6e25407}{ecore\+\_\+con\+\_\+server\+\_\+timeout\+\_\+set()} 

\hyperlink{group__Ecore__Con__Client__Group_gaa09134e1e8c30f0cc07a57c9bd7788df}{ecore\+\_\+con\+\_\+client\+\_\+timeout\+\_\+get()} 
\end{DoxySeeAlso}
\hypertarget{group__Ecore__Con__Server__Group_ga79c76b9f725ceda216e9c7e5caf6cbd9}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+del@{ecore\+\_\+con\+\_\+server\+\_\+del}}
\index{ecore\+\_\+con\+\_\+server\+\_\+del@{ecore\+\_\+con\+\_\+server\+\_\+del}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+del}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void $\ast$ ecore\+\_\+con\+\_\+server\+\_\+del (
\begin{DoxyParamCaption}
\item[{Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga79c76b9f725ceda216e9c7e5caf6cbd9}


Closes the connection and frees the given server. 


\begin{DoxyParams}{Parameters}
{\em svr} & The given server. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Data associated with the server when it was created.
\end{DoxyReturn}
All the clients connected to this server will be disconnected.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Ecore__Con__Server__Group_gaf450c4039d5e61d4f7a58d7b67efc1e8}{ecore\+\_\+con\+\_\+server\+\_\+add}, \hyperlink{group__Ecore__Con__Server__Group_gae3d7391f7da5e0f748d7b6804d010b2f}{ecore\+\_\+con\+\_\+server\+\_\+connect} 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_client_simple_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+simple\+\_\+example.\+c}.\end{Desc}


Referenced by ecore\+\_\+ipc\+\_\+server\+\_\+del().

\hypertarget{group__Ecore__Con__Server__Group_ga0a03ab73a105ad9a17265966f5683625}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get}}
\index{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void $\ast$ ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get (
\begin{DoxyParamCaption}
\item[{Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga0a03ab73a105ad9a17265966f5683625}


Retrieves the data associated with the given server. 


\begin{DoxyParams}{Parameters}
{\em svr} & The given server. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The associated data.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Ecore__Con__Server__Group_ga09ee7d7908fb1588740b19ba22d7c29d}{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set()} 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_client_simple_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+simple\+\_\+example.\+c}.\end{Desc}
\hypertarget{group__Ecore__Con__Server__Group_ga09ee7d7908fb1588740b19ba22d7c29d}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set@{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set}}
\index{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set@{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void $\ast$ ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+set (
\begin{DoxyParamCaption}
\item[{Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr, }
\item[{void $\ast$}]{data}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga09ee7d7908fb1588740b19ba22d7c29d}


Sets the data associated with the given server. 


\begin{DoxyParams}{Parameters}
{\em svr} & The given server. \\
\hline
{\em data} & The data to associate with {\ttfamily svr} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The previously associated data, if any.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Ecore__Con__Server__Group_ga0a03ab73a105ad9a17265966f5683625}{ecore\+\_\+con\+\_\+server\+\_\+data\+\_\+get()} 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_client_simple_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+simple\+\_\+example.\+c}.\end{Desc}


Referenced by ecore\+\_\+con\+\_\+server\+\_\+add(), and ecore\+\_\+con\+\_\+server\+\_\+connect().

\hypertarget{group__Ecore__Con__Server__Group_ga68bd9a81d91669aa6c85e41460acb100}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+connected\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+connected\+\_\+get}}
\index{ecore\+\_\+con\+\_\+server\+\_\+connected\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+connected\+\_\+get}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+connected\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Bool} ecore\+\_\+con\+\_\+server\+\_\+connected\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga68bd9a81d91669aa6c85e41460acb100}


Retrieves whether the given server is currently connected. 


\begin{DoxyParams}{Parameters}
{\em svr} & The given server. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily E\+I\+N\+A\+\_\+\+T\+R\+U\+E} if the server is connected, {\ttfamily E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E} otherwise. 
\end{DoxyReturn}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_client_simple_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+simple\+\_\+example.\+c}.\end{Desc}


Referenced by ecore\+\_\+ipc\+\_\+server\+\_\+connected\+\_\+get().

\hypertarget{group__Ecore__Con__Server__Group_gac21ef0f2db46b32042160b83534138f9}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+port\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+port\+\_\+get}}
\index{ecore\+\_\+con\+\_\+server\+\_\+port\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+port\+\_\+get}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+port\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int ecore\+\_\+con\+\_\+server\+\_\+port\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_gac21ef0f2db46b32042160b83534138f9}


Retrieves the server port in use. 


\begin{DoxyParams}{Parameters}
{\em svr} & The given server. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The server port in use.
\end{DoxyReturn}
The port where the server is listening for connections. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_client_simple_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+simple\+\_\+example.\+c}.\end{Desc}
\hypertarget{group__Ecore__Con__Server__Group_gadf16abc2d4fc16a8b65709eab2cd8337}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+send@{ecore\+\_\+con\+\_\+server\+\_\+send}}
\index{ecore\+\_\+con\+\_\+server\+\_\+send@{ecore\+\_\+con\+\_\+server\+\_\+send}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+send}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int ecore\+\_\+con\+\_\+server\+\_\+send (
\begin{DoxyParamCaption}
\item[{Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr, }
\item[{const void $\ast$}]{data, }
\item[{int}]{size}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_gadf16abc2d4fc16a8b65709eab2cd8337}


Sends the given data to the given server. 


\begin{DoxyParams}{Parameters}
{\em svr} & The given server. \\
\hline
{\em data} & The given data. \\
\hline
{\em size} & Length of the data, in bytes, to send. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of bytes sent. {\ttfamily 0} will be returned if there is an error.
\end{DoxyReturn}
This function will send the given data to the server as soon as the program is back to the main loop. Thus, this function returns immediately (non-\/blocking). If the data needs to be sent {\bfseries now}, call \hyperlink{group__Ecore__Con__Server__Group_ga3ddb6c88484b59a1f5a5bacb8b6e60fe}{ecore\+\_\+con\+\_\+server\+\_\+flush()} after this one.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Ecore__Con__Client__Group_ga166fd469acaa809faa4247b12d79278f}{ecore\+\_\+con\+\_\+client\+\_\+send()} 

\hyperlink{group__Ecore__Con__Server__Group_ga3ddb6c88484b59a1f5a5bacb8b6e60fe}{ecore\+\_\+con\+\_\+server\+\_\+flush()} 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_client_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+example.\+c}, and \hyperlink{ecore_con_client_simple_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+simple\+\_\+example.\+c}.\end{Desc}


Referenced by ecore\+\_\+con\+\_\+eet\+\_\+raw\+\_\+send(), and ecore\+\_\+ipc\+\_\+server\+\_\+send().

\hypertarget{group__Ecore__Con__Server__Group_gaea2a907ae4ca478a360928fd16654d45}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+ip\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+ip\+\_\+get}}
\index{ecore\+\_\+con\+\_\+server\+\_\+ip\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+ip\+\_\+get}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+ip\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} const char $\ast$ ecore\+\_\+con\+\_\+server\+\_\+ip\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_gaea2a907ae4ca478a360928fd16654d45}


Gets the I\+P address of a server that has been connected to. 


\begin{DoxyParams}{Parameters}
{\em svr} & The given server. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to an internal string that contains the I\+P address of the connected server in the form \char`\"{}\+X\+X\+X.\+Y\+Y\+Y.\+Z\+Z\+Z.\+A\+A\+A\char`\"{} I\+P notation. This string should not be modified or trusted to stay valid after deletion for the {\ttfamily svr} object. If no I\+P is known {\ttfamily N\+U\+L\+L} is returned. 
\end{DoxyReturn}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_client_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+example.\+c}, and \hyperlink{ecore_con_client_simple_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+simple\+\_\+example.\+c}.\end{Desc}


Referenced by ecore\+\_\+ipc\+\_\+server\+\_\+ip\+\_\+get().

\hypertarget{group__Ecore__Con__Server__Group_ga1f7c1040e60e9e9a53a9a01f70aa52b3}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+uptime\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+uptime\+\_\+get}}
\index{ecore\+\_\+con\+\_\+server\+\_\+uptime\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+uptime\+\_\+get}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+uptime\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} double ecore\+\_\+con\+\_\+server\+\_\+uptime\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga1f7c1040e60e9e9a53a9a01f70aa52b3}


Check how long a server has been connected. 


\begin{DoxyParams}{Parameters}
{\em svr} & The server to check \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The total time, in seconds, that the server has been connected/running
\end{DoxyReturn}
This function is used to find out the time that has been elapsed since \hyperlink{group__Ecore__Con__Server__Group_gaf450c4039d5e61d4f7a58d7b67efc1e8}{ecore\+\_\+con\+\_\+server\+\_\+add()} succeeded. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_server_simple_example_8c-example}{ecore\+\_\+con\+\_\+server\+\_\+simple\+\_\+example.\+c}.\end{Desc}
\hypertarget{group__Ecore__Con__Server__Group_ga3ddb6c88484b59a1f5a5bacb8b6e60fe}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+flush@{ecore\+\_\+con\+\_\+server\+\_\+flush}}
\index{ecore\+\_\+con\+\_\+server\+\_\+flush@{ecore\+\_\+con\+\_\+server\+\_\+flush}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+flush}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void ecore\+\_\+con\+\_\+server\+\_\+flush (
\begin{DoxyParamCaption}
\item[{Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga3ddb6c88484b59a1f5a5bacb8b6e60fe}


Flushes all pending data to the given server. 


\begin{DoxyParams}{Parameters}
{\em svr} & The given server.\\
\hline
\end{DoxyParams}
This function will block until all data is sent to the server.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Ecore__Con__Server__Group_gadf16abc2d4fc16a8b65709eab2cd8337}{ecore\+\_\+con\+\_\+server\+\_\+send()} 

\hyperlink{group__Ecore__Con__Client__Group_gaccf37688bb1ecbedc8791b5b43c1595c}{ecore\+\_\+con\+\_\+client\+\_\+flush()} 
\end{DoxySeeAlso}
\begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_client_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+example.\+c}, and \hyperlink{ecore_con_client_simple_example_8c-example}{ecore\+\_\+con\+\_\+client\+\_\+simple\+\_\+example.\+c}.\end{Desc}


Referenced by ecore\+\_\+ipc\+\_\+server\+\_\+flush().

\hypertarget{group__Ecore__Con__Server__Group_gabaef36c991be8922766611c75372ced4}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+client\+\_\+limit\+\_\+set@{ecore\+\_\+con\+\_\+server\+\_\+client\+\_\+limit\+\_\+set}}
\index{ecore\+\_\+con\+\_\+server\+\_\+client\+\_\+limit\+\_\+set@{ecore\+\_\+con\+\_\+server\+\_\+client\+\_\+limit\+\_\+set}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+client\+\_\+limit\+\_\+set}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void ecore\+\_\+con\+\_\+server\+\_\+client\+\_\+limit\+\_\+set (
\begin{DoxyParamCaption}
\item[{Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr, }
\item[{int}]{client\+\_\+limit, }
\item[{char}]{reject\+\_\+excess\+\_\+clients}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_gabaef36c991be8922766611c75372ced4}


Sets a limit on the number of clients that can be handled concurrently by the given server, and a policy on what to do if excess clients try to connect. 


\begin{DoxyParams}{Parameters}
{\em svr} & The given server. \\
\hline
{\em client\+\_\+limit} & The maximum number of clients to handle concurrently. -\/1 means unlimited (default). 0 effectively disables the server. \\
\hline
{\em reject\+\_\+excess\+\_\+clients} & Set to 1 to automatically disconnect excess clients as soon as they connect if you are already handling client\+\_\+limit clients. Set to 0 (default) to just hold off on the \char`\"{}accept()\char`\"{} system call until the number of active clients drops. This causes the kernel to queue up to 4096 connections (or your kernel's limit, whichever is lower).\\
\hline
\end{DoxyParams}
Beware that if you set this once ecore is already running, you may already have pending C\+L\+I\+E\+N\+T\+\_\+\+A\+D\+D events in your event queue. Those clients have already connected and will not be affected by this call. Only clients subsequently trying to connect will be affected. \begin{Desc}
\item[Examples\+: ]\par
\hyperlink{ecore_con_server_simple_example_8c-example}{ecore\+\_\+con\+\_\+server\+\_\+simple\+\_\+example.\+c}.\end{Desc}


Referenced by ecore\+\_\+ipc\+\_\+server\+\_\+client\+\_\+limit\+\_\+set().

\hypertarget{group__Ecore__Con__Server__Group_ga1a97c1a6eafdf856643b586729de00b5}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+server\+\_\+fd\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+fd\+\_\+get}}
\index{ecore\+\_\+con\+\_\+server\+\_\+fd\+\_\+get@{ecore\+\_\+con\+\_\+server\+\_\+fd\+\_\+get}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+server\+\_\+fd\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int ecore\+\_\+con\+\_\+server\+\_\+fd\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Ecore\+\_\+\+Con\+\_\+\+Server $\ast$}]{svr}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga1a97c1a6eafdf856643b586729de00b5}


Get the fd that the server is connected to. 


\begin{DoxyParams}{Parameters}
{\em svr} & The server object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The fd, or -\/1 on failure
\end{DoxyReturn}
This function returns the fd which is used by the underlying server connection. It should not be tampered with unless you R\+E\+A\+L\+L\+Y know what you are doing. \begin{DoxyNote}{Note}
This function is only valid for servers created with \hyperlink{group__Ecore__Con__Server__Group_gae3d7391f7da5e0f748d7b6804d010b2f}{ecore\+\_\+con\+\_\+server\+\_\+connect()} 
\end{DoxyNote}
\begin{DoxyWarning}{Warning}
Seriously. Don't use this unless you know what you are doing. 
\end{DoxyWarning}
\begin{DoxySince}{Since}
1.\+1 
\end{DoxySince}
\hypertarget{group__Ecore__Con__Server__Group_ga43decb7ba52a2b14cfa563b60659491c}{\index{Ecore Connection Server Functions@{Ecore Connection Server Functions}!ecore\+\_\+con\+\_\+client\+\_\+fd\+\_\+get@{ecore\+\_\+con\+\_\+client\+\_\+fd\+\_\+get}}
\index{ecore\+\_\+con\+\_\+client\+\_\+fd\+\_\+get@{ecore\+\_\+con\+\_\+client\+\_\+fd\+\_\+get}!Ecore Connection Server Functions@{Ecore Connection Server Functions}}
\subsubsection[{ecore\+\_\+con\+\_\+client\+\_\+fd\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int ecore\+\_\+con\+\_\+client\+\_\+fd\+\_\+get (
\begin{DoxyParamCaption}
\item[{const Ecore\+\_\+\+Con\+\_\+\+Client $\ast$}]{cl}
\end{DoxyParamCaption}
)}}\label{group__Ecore__Con__Server__Group_ga43decb7ba52a2b14cfa563b60659491c}


Get the fd that the client is connected to. 


\begin{DoxyParams}{Parameters}
{\em cl} & The client object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The fd, or -\/1 on failure
\end{DoxyReturn}
This function returns the fd which is used by the underlying client connection. It should not be tampered with unless you R\+E\+A\+L\+L\+Y know what you are doing. \begin{DoxySince}{Since}
1.\+1 
\end{DoxySince}
