\hypertarget{group__Eet__Connection__Group}{}\section{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 \hyperlink{group__Eet__Data__Group}{Eet Data Serialization} to be send.  


\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}\label{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}} 
typedef struct \+\_\+\+Eet\+\_\+\+Connection \hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{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 \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eet__Connection__Group_ga5102e63d70331d6a5ffb87d42a8ed401}{Eet\+\_\+\+Read\+\_\+\+Cb}(const void $\ast$eet\+\_\+data, size\+\_\+t size, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Called back when an \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 \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eet__Connection__Group_ga4e0c17177596c1ee1cecda84056ab45b}{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 \hyperlink{group__Eet__Data__Group}{Eet Data Serialization} data is ready to be send. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} \hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$ \hyperlink{group__Eet__Connection__Group_gad6e015fb8184ede006af9939311e04ca}{eet\+\_\+connection\+\_\+new} (\hyperlink{group__Eet__Connection__Group_ga5102e63d70331d6a5ffb87d42a8ed401}{Eet\+\_\+\+Read\+\_\+\+Cb} $\ast$eet\+\_\+read\+\_\+cb, \hyperlink{group__Eet__Connection__Group_ga4e0c17177596c1ee1cecda84056ab45b}{Eet\+\_\+\+Write\+\_\+\+Cb} $\ast$eet\+\_\+write\+\_\+cb, const void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Instanciate a new connection to track. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} int \hyperlink{group__Eet__Connection__Group_gad862fb515beabce583dd60d10a78011f}{eet\+\_\+connection\+\_\+received} (\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$conn, const void $\ast$data, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Process a raw packet received over the link. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eet__Connection__Group_ga4541f9e53bdb2222a452067cfa79a80e}{eet\+\_\+connection\+\_\+empty} (\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$conn)
\begin{DoxyCompactList}\small\item\em Tell if the Eet\+\_\+\+Connection as received some partial data. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eet__Connection__Group_gacd2289a85daa867e290a5f3e0e0d492d}{eet\+\_\+connection\+\_\+send} (\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$conn, \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 Convert a complex structure and prepare it to be send. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eet__Connection__Group_ga3e9d92c3bffdace3fcb0e6de04fea59a}{eet\+\_\+connection\+\_\+node\+\_\+send} (\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$conn, \hyperlink{group__Eet__Node__Group_gaf589647d3f0fb3e3d03a5c42cd23f51c}{Eet\+\_\+\+Node} $\ast$node, const char $\ast$cipher\+\_\+key)
\begin{DoxyCompactList}\small\item\em Convert a Eet\+\_\+\+Node tree and prepare it to be send. \end{DoxyCompactList}\item 
\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} void $\ast$ \hyperlink{group__Eet__Connection__Group_gad2f7b44fac8b9ad475db133c1c872d9e}{eet\+\_\+connection\+\_\+close} (\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$conn, \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} $\ast$on\+\_\+going)
\begin{DoxyCompactList}\small\item\em Close a connection and lost its track. \end{DoxyCompactList}\end{DoxyCompactItemize}


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



\subsection{Function Documentation}
\mbox{\Hypertarget{group__Eet__Connection__Group_gad6e015fb8184ede006af9939311e04ca}\label{group__Eet__Connection__Group_gad6e015fb8184ede006af9939311e04ca}} 
\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}}
\subsubsection{\texorpdfstring{eet\+\_\+connection\+\_\+new()}{eet\_connection\_new()}}
{\footnotesize\ttfamily \hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} \hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection}$\ast$ eet\+\_\+connection\+\_\+new (\begin{DoxyParamCaption}\item[{\hyperlink{group__Eet__Connection__Group_ga5102e63d70331d6a5ffb87d42a8ed401}{Eet\+\_\+\+Read\+\_\+\+Cb} $\ast$}]{eet\+\_\+read\+\_\+cb,  }\item[{\hyperlink{group__Eet__Connection__Group_ga4e0c17177596c1ee1cecda84056ab45b}{Eet\+\_\+\+Write\+\_\+\+Cb} $\ast$}]{eet\+\_\+write\+\_\+cb,  }\item[{const void $\ast$}]{user\+\_\+data }\end{DoxyParamCaption})}



Instanciate 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}
N\+U\+LL 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}}
\subsubsection{\texorpdfstring{eet\+\_\+connection\+\_\+received()}{eet\_connection\_received()}}
{\footnotesize\ttfamily \hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} int eet\+\_\+connection\+\_\+received (\begin{DoxyParamCaption}\item[{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$}]{conn,  }\item[{const void $\ast$}]{data,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Process 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}
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}


References E\+I\+N\+A\+\_\+\+F\+A\+L\+SE, and E\+I\+N\+A\+\_\+\+T\+R\+UE.

\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}}
\subsubsection{\texorpdfstring{eet\+\_\+connection\+\_\+empty()}{eet\_connection\_empty()}}
{\footnotesize\ttfamily \hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} eet\+\_\+connection\+\_\+empty (\begin{DoxyParamCaption}\item[{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$}]{conn }\end{DoxyParamCaption})}



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


\begin{DoxyParams}{Parameters}
{\em conn} & Connection handler to request. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
E\+I\+N\+A\+\_\+\+T\+R\+UE if there is some data pending inside, E\+I\+N\+A\+\_\+\+F\+A\+L\+SE 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 E\+I\+N\+A\+\_\+\+F\+A\+L\+SE, and E\+I\+N\+A\+\_\+\+T\+R\+UE.

\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}}
\subsubsection{\texorpdfstring{eet\+\_\+connection\+\_\+send()}{eet\_connection\_send()}}
{\footnotesize\ttfamily \hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} eet\+\_\+connection\+\_\+send (\begin{DoxyParamCaption}\item[{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$}]{conn,  }\item[{\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})}



Convert 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}
E\+I\+N\+A\+\_\+\+T\+R\+UE if the data where correctly send, E\+I\+N\+A\+\_\+\+F\+A\+L\+SE 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}
\hyperlink{group__Eet__Data__Cipher__Group_gab765474a660b0dfe5f00d99a960206db}{eet\+\_\+data\+\_\+descriptor\+\_\+encode\+\_\+cipher}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+2.\+4 
\end{DoxySince}


References E\+I\+N\+A\+\_\+\+F\+A\+L\+SE.

\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}}
\subsubsection{\texorpdfstring{eet\+\_\+connection\+\_\+node\+\_\+send()}{eet\_connection\_node\_send()}}
{\footnotesize\ttfamily \hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} eet\+\_\+connection\+\_\+node\+\_\+send (\begin{DoxyParamCaption}\item[{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$}]{conn,  }\item[{\hyperlink{group__Eet__Node__Group_gaf589647d3f0fb3e3d03a5c42cd23f51c}{Eet\+\_\+\+Node} $\ast$}]{node,  }\item[{const char $\ast$}]{cipher\+\_\+key }\end{DoxyParamCaption})}



Convert 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}
E\+I\+N\+A\+\_\+\+T\+R\+UE if the data where correctly send, E\+I\+N\+A\+\_\+\+F\+A\+L\+SE 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}
\hyperlink{group__Eet__Node__Group_ga665a2c4f2ea2621bbe8f9852b102a13c}{eet\+\_\+data\+\_\+node\+\_\+encode\+\_\+cipher}
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
1.\+2.\+4 
\end{DoxySince}


References E\+I\+N\+A\+\_\+\+F\+A\+L\+SE.

\mbox{\Hypertarget{group__Eet__Connection__Group_gad2f7b44fac8b9ad475db133c1c872d9e}\label{group__Eet__Connection__Group_gad2f7b44fac8b9ad475db133c1c872d9e}} 
\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}}
\subsubsection{\texorpdfstring{eet\+\_\+connection\+\_\+close()}{eet\_connection\_close()}}
{\footnotesize\ttfamily \hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI} void$\ast$ eet\+\_\+connection\+\_\+close (\begin{DoxyParamCaption}\item[{\hyperlink{group__Eet__Connection__Group_ga74fdc0339a17a94ce451e5a9870a66f4}{Eet\+\_\+\+Connection} $\ast$}]{conn,  }\item[{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} $\ast$}]{on\+\_\+going }\end{DoxyParamCaption})}



Close 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 E\+I\+N\+A\+\_\+\+F\+A\+L\+SE, and E\+I\+N\+A\+\_\+\+T\+R\+UE.

