\hypertarget{group__Eet__Connection__Group}{}\doxysection{Helper function to use eet over a network link}
\label{group__Eet__Connection__Group}\index{Helper function to use eet over a network link@{Helper function to use eet over a network link}}


Function that reconstruct and prepare packet of \mbox{\hyperlink{group__Eet__Data__Group}{Eet Data Serialization}} to be send.  


\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}\label{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}} 
typedef struct \+\_\+\+Eet\+\_\+\+Connection {\bfseries Eet\+\_\+\+Connection}
\begin{DoxyCompactList}\small\item\em Opaque handle to track paquet for a specific connection. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eet__Connection__Group_ga5102e63d70331d6a5ffb87d42a8ed401}\label{group__Eet__Connection__Group_ga5102e63d70331d6a5ffb87d42a8ed401}} 
typedef \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} {\bfseries Eet\+\_\+\+Read\+\_\+\+Cb}(const void $\ast$eet\+\_\+data, size\+\_\+t size, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Called back when an \mbox{\hyperlink{group__Eet__Data__Group}{Eet Data Serialization}} has been received completely and could be used. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eet__Connection__Group_ga4e0c17177596c1ee1cecda84056ab45b}\label{group__Eet__Connection__Group_ga4e0c17177596c1ee1cecda84056ab45b}} 
typedef \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} {\bfseries Eet\+\_\+\+Write\+\_\+\+Cb}(const void $\ast$data, size\+\_\+t size, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Called back when a packet containing \mbox{\hyperlink{group__Eet__Data__Group}{Eet Data Serialization}} data is ready to be send. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
EAPI \mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$ \mbox{\hyperlink{group__Eet__Connection__Group_ga54a9396264af985cf4fd216fd146d967}{eet\+\_\+connection\+\_\+new}} (\mbox{\hyperlink{group__Eet__Connection__Group_ga5102e63d70331d6a5ffb87d42a8ed401}{Eet\+\_\+\+Read\+\_\+\+Cb}} $\ast$eet\+\_\+read\+\_\+cb, \mbox{\hyperlink{group__Eet__Connection__Group_ga4e0c17177596c1ee1cecda84056ab45b}{Eet\+\_\+\+Write\+\_\+\+Cb}} $\ast$eet\+\_\+write\+\_\+cb, const void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Instanciates a new connection to track. \end{DoxyCompactList}\item 
EAPI int \mbox{\hyperlink{group__Eet__Connection__Group_gad862fb515beabce583dd60d10a78011f}{eet\+\_\+connection\+\_\+received}} (\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$conn, const void $\ast$data, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Processes a raw packet received over the link. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eet__Connection__Group_ga4541f9e53bdb2222a452067cfa79a80e}{eet\+\_\+connection\+\_\+empty}} (\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$conn)
\begin{DoxyCompactList}\small\item\em Tells if the Eet\+\_\+\+Connection as received some partial data. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eet__Connection__Group_gacd2289a85daa867e290a5f3e0e0d492d}{eet\+\_\+connection\+\_\+send}} (\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$conn, \mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$edd, const void $\ast$data\+\_\+in, const char $\ast$cipher\+\_\+key)
\begin{DoxyCompactList}\small\item\em Converts a complex structure and prepare it to be send. \end{DoxyCompactList}\item 
EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eet__Connection__Group_ga3e9d92c3bffdace3fcb0e6de04fea59a}{eet\+\_\+connection\+\_\+node\+\_\+send}} (\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$conn, \mbox{\hyperlink{group__Eet__Node__Group_gaf589647d3f0fb3e3d03a5c42cd23f51c}{Eet\+\_\+\+Node}} $\ast$node, const char $\ast$cipher\+\_\+key)
\begin{DoxyCompactList}\small\item\em Converts a Eet\+\_\+\+Node tree and prepare it to be send. \end{DoxyCompactList}\item 
EAPI void $\ast$ \mbox{\hyperlink{group__Eet__Connection__Group_ga9e4fa4c43cde37d0767b66d382dc4a64}{eet\+\_\+connection\+\_\+close}} (\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$conn, \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} $\ast$on\+\_\+going)
\begin{DoxyCompactList}\small\item\em Closes a connection and lost its track. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Function that reconstruct and prepare packet of \mbox{\hyperlink{group__Eet__Data__Group}{Eet Data Serialization}} to be send. 



\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Eet__Connection__Group_ga54a9396264af985cf4fd216fd146d967}\label{group__Eet__Connection__Group_ga54a9396264af985cf4fd216fd146d967}} 
\index{Helper function to use eet over a network link@{Helper function to use eet over a network link}!eet\_connection\_new@{eet\_connection\_new}}
\index{eet\_connection\_new@{eet\_connection\_new}!Helper function to use eet over a network link@{Helper function to use eet over a network link}}
\doxysubsubsection{\texorpdfstring{eet\_connection\_new()}{eet\_connection\_new()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$ eet\+\_\+connection\+\_\+new (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__Connection__Group_ga5102e63d70331d6a5ffb87d42a8ed401}{Eet\+\_\+\+Read\+\_\+\+Cb}} $\ast$}]{eet\+\_\+read\+\_\+cb,  }\item[{\mbox{\hyperlink{group__Eet__Connection__Group_ga4e0c17177596c1ee1cecda84056ab45b}{Eet\+\_\+\+Write\+\_\+\+Cb}} $\ast$}]{eet\+\_\+write\+\_\+cb,  }\item[{const void $\ast$}]{user\+\_\+data }\end{DoxyParamCaption})}



Instanciates a new connection to track. 


\begin{DoxyParams}{Parameters}
{\em eet\+\_\+read\+\_\+cb} & Function to call when one Eet\+\_\+\+Data packet has been fully assemble. \\
\hline
{\em eet\+\_\+write\+\_\+cb} & Function to call when one Eet\+\_\+\+Data packet is ready to be send over the wire. \\
\hline
{\em user\+\_\+data} & Pointer provided to both functions to be used as a context handler. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily NULL} on failure, or a valid Eet\+\_\+\+Connection handler.
\end{DoxyReturn}
For every connection to track you will need a separate Eet\+\_\+\+Connection provider.

\begin{DoxySince}{Since}
1.\+2.\+4 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__Connection__Group_gad862fb515beabce583dd60d10a78011f}\label{group__Eet__Connection__Group_gad862fb515beabce583dd60d10a78011f}} 
\index{Helper function to use eet over a network link@{Helper function to use eet over a network link}!eet\_connection\_received@{eet\_connection\_received}}
\index{eet\_connection\_received@{eet\_connection\_received}!Helper function to use eet over a network link@{Helper function to use eet over a network link}}
\doxysubsubsection{\texorpdfstring{eet\_connection\_received()}{eet\_connection\_received()}}
{\footnotesize\ttfamily EAPI int eet\+\_\+connection\+\_\+received (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$}]{conn,  }\item[{const void $\ast$}]{data,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Processes a raw packet received over the link. 


\begin{DoxyParams}{Parameters}
{\em conn} & Connection handler to track. \\
\hline
{\em data} & Raw data packet. \\
\hline
{\em size} & The size of that packet. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily 0} on complete success, any other value indicate where in the stream it got wrong (It could be before that packet).
\end{DoxyReturn}
Every time you receive a packet related to your connection, you should pass it to that function so that it could process and assemble packet has you receive it. It will automatically call Eet\+\_\+\+Read\+\_\+\+Cb when one is fully received.

\begin{DoxySince}{Since}
1.\+2.\+4 
\end{DoxySince}
\mbox{\Hypertarget{group__Eet__Connection__Group_ga4541f9e53bdb2222a452067cfa79a80e}\label{group__Eet__Connection__Group_ga4541f9e53bdb2222a452067cfa79a80e}} 
\index{Helper function to use eet over a network link@{Helper function to use eet over a network link}!eet\_connection\_empty@{eet\_connection\_empty}}
\index{eet\_connection\_empty@{eet\_connection\_empty}!Helper function to use eet over a network link@{Helper function to use eet over a network link}}
\doxysubsubsection{\texorpdfstring{eet\_connection\_empty()}{eet\_connection\_empty()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eet\+\_\+connection\+\_\+empty (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$}]{conn }\end{DoxyParamCaption})}



Tells if the Eet\+\_\+\+Connection as received some partial data. 


\begin{DoxyParams}{Parameters}
{\em conn} & Connection handler to request. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily EINA\+\_\+\+TRUE} if there is some data pending inside, {\ttfamily EINA\+\_\+\+FALSE} otherwise.
\end{DoxyReturn}
Eet\+\_\+\+Connection buffer data until the received data can be unserialized correctly. This function let you know if there is some data inside that buffer waiting for more data to be received before being processed.

\begin{DoxySince}{Since}
1.\+7 
\end{DoxySince}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.

\mbox{\Hypertarget{group__Eet__Connection__Group_gacd2289a85daa867e290a5f3e0e0d492d}\label{group__Eet__Connection__Group_gacd2289a85daa867e290a5f3e0e0d492d}} 
\index{Helper function to use eet over a network link@{Helper function to use eet over a network link}!eet\_connection\_send@{eet\_connection\_send}}
\index{eet\_connection\_send@{eet\_connection\_send}!Helper function to use eet over a network link@{Helper function to use eet over a network link}}
\doxysubsubsection{\texorpdfstring{eet\_connection\_send()}{eet\_connection\_send()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eet\+\_\+connection\+\_\+send (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$}]{conn,  }\item[{\mbox{\hyperlink{group__Eet__Data__Group_ga4baec0e840012480a0958c5c3bca276d}{Eet\+\_\+\+Data\+\_\+\+Descriptor}} $\ast$}]{edd,  }\item[{const void $\ast$}]{data\+\_\+in,  }\item[{const char $\ast$}]{cipher\+\_\+key }\end{DoxyParamCaption})}



Converts a complex structure and prepare it to be send. 


\begin{DoxyParams}{Parameters}
{\em conn} & Connection handler to track. \\
\hline
{\em edd} & The data descriptor to use when encoding. \\
\hline
{\em data\+\_\+in} & The pointer to the struct to encode into data. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily EINA\+\_\+\+TRUE} if the data where correctly send, {\ttfamily EINA\+\_\+\+FALSE} if they don\textquotesingle{}t.
\end{DoxyReturn}
This function serialize data\+\_\+in with edd, assemble the packet and call Eet\+\_\+\+Write\+\_\+\+Cb when ready. The data passed Eet\+\_\+\+Write\+\_\+\+Cb are temporary allocated and will vanish just after the return of the callback.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Data__Cipher__Group_gac31bca0d53d723a7fcb6b38135f348b7}{eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+2.\+4 
\end{DoxySince}


References \mbox{\hyperlink{group__Eet__Data__Cipher__Group_gac31bca0d53d723a7fcb6b38135f348b7}{eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher()}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.

\mbox{\Hypertarget{group__Eet__Connection__Group_ga3e9d92c3bffdace3fcb0e6de04fea59a}\label{group__Eet__Connection__Group_ga3e9d92c3bffdace3fcb0e6de04fea59a}} 
\index{Helper function to use eet over a network link@{Helper function to use eet over a network link}!eet\_connection\_node\_send@{eet\_connection\_node\_send}}
\index{eet\_connection\_node\_send@{eet\_connection\_node\_send}!Helper function to use eet over a network link@{Helper function to use eet over a network link}}
\doxysubsubsection{\texorpdfstring{eet\_connection\_node\_send()}{eet\_connection\_node\_send()}}
{\footnotesize\ttfamily EAPI \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eet\+\_\+connection\+\_\+node\+\_\+send (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$}]{conn,  }\item[{\mbox{\hyperlink{group__Eet__Node__Group_gaf589647d3f0fb3e3d03a5c42cd23f51c}{Eet\+\_\+\+Node}} $\ast$}]{node,  }\item[{const char $\ast$}]{cipher\+\_\+key }\end{DoxyParamCaption})}



Converts a Eet\+\_\+\+Node tree and prepare it to be send. 


\begin{DoxyParams}{Parameters}
{\em conn} & Connection handler to track. \\
\hline
{\em node} & The data tree to use when encoding. \\
\hline
{\em cipher\+\_\+key} & The key to use as cipher. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
{\ttfamily EINA\+\_\+\+TRUE} if the data where correctly send, {\ttfamily EINA\+\_\+\+FALSE} if they don\textquotesingle{}t.
\end{DoxyReturn}
This function serialize node, assemble the packet and call Eet\+\_\+\+Write\+\_\+\+Cb when ready. The data passed Eet\+\_\+\+Write\+\_\+\+Cb are temporary allocated and will vanish just after the return of the callback.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{group__Eet__Node__Group_ga545987388fbc836ca963a0bbc26269f5}{eet\+\_\+data\+\_\+node\+\_\+encode\+\_\+cipher}}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+2.\+4 
\end{DoxySince}


References \mbox{\hyperlink{group__Eet__Node__Group_ga545987388fbc836ca963a0bbc26269f5}{eet\+\_\+data\+\_\+node\+\_\+encode\+\_\+cipher()}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, \mbox{\hyperlink{group__Eina__Safety__Checks__Group_gab2b07061fc6500dedd9cd41c8d16f95d}{EINA\+\_\+\+SAFETY\+\_\+\+ON\+\_\+\+NULL\+\_\+\+RETURN\+\_\+\+VAL}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.

\mbox{\Hypertarget{group__Eet__Connection__Group_ga9e4fa4c43cde37d0767b66d382dc4a64}\label{group__Eet__Connection__Group_ga9e4fa4c43cde37d0767b66d382dc4a64}} 
\index{Helper function to use eet over a network link@{Helper function to use eet over a network link}!eet\_connection\_close@{eet\_connection\_close}}
\index{eet\_connection\_close@{eet\_connection\_close}!Helper function to use eet over a network link@{Helper function to use eet over a network link}}
\doxysubsubsection{\texorpdfstring{eet\_connection\_close()}{eet\_connection\_close()}}
{\footnotesize\ttfamily EAPI void $\ast$ eet\+\_\+connection\+\_\+close (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}} $\ast$}]{conn,  }\item[{\mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} $\ast$}]{on\+\_\+going }\end{DoxyParamCaption})}



Closes a connection and lost its track. 


\begin{DoxyParams}{Parameters}
{\em conn} & Connection handler to close. \\
\hline
{\em on\+\_\+going} & Signal if a partial packet wasn\textquotesingle{}t completed. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the user\+\_\+data passed to both callback.
\end{DoxyReturn}
\begin{DoxySince}{Since}
1.\+2.\+4 
\end{DoxySince}


References \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\+\_\+\+FALSE}}, and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\+\_\+\+TRUE}}.

