client_8cpp.tex 4.58 KB
\hypertarget{client_8cpp}{\section{Referencia del Archivo /home/imanol/devel/eclipse/\-P\-A\-D/\-J\-Chat\-Client/src/client.cpp}
\label{client_8cpp}\index{/home/imanol/devel/eclipse/\-P\-A\-D/\-J\-Chat\-Client/src/client.\-cpp@{/home/imanol/devel/eclipse/\-P\-A\-D/\-J\-Chat\-Client/src/client.\-cpp}}
}


Fichero de implementación de un cliente.  


{\ttfamily \#include \char`\"{}Socket.\-h\char`\"{}}\\*
{\ttfamily \#include $<$iostream$>$}\\*
{\ttfamily \#include \char`\"{}Socket\-Exception.\-h\char`\"{}}\\*
{\ttfamily \#include $<$sstream$>$}\\*
{\ttfamily \#include $<$signal.\-h$>$}\\*
{\ttfamily \#include $<$cstdlib$>$}\\*
{\ttfamily \#include $<$sys/time.\-h$>$}\\*
\subsection*{Funciones}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{client_8cpp_a00a6f7afcba6bb656a7b05c67efa42ba}{exit\-Client} (int signal)
\begin{DoxyCompactList}\small\item\em Método para terminar el cliente. \end{DoxyCompactList}\item 
bool \hyperlink{client_8cpp_ab4a3d59d9d8c97b79cb3a6cb6a0e403c}{connect} (\hyperlink{class_socket}{Socket} \&s)
\item 
void \hyperlink{client_8cpp_adce119cd6356a05c4703195cc608e17c}{speed\-Test} (\hyperlink{class_socket}{Socket} \&s)
\item 
int \hyperlink{client_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4}{main} ()
\begin{DoxyCompactList}\small\item\em Método principal del cliente. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{client_8cpp_ab36823025f12a809217f7771125658c2}{connected}
\item 
bool \hyperlink{client_8cpp_a9324389a5cdc532c6417a87ccafe18ce}{finished}
\end{DoxyCompactItemize}


\subsection{Descripción detallada}
Fichero de implementación de un cliente. \begin{DoxyAuthor}{Autor}
Imanol Barba Sabariego 
\end{DoxyAuthor}
\begin{DoxyDate}{Fecha}
13/06/2013
\end{DoxyDate}
En este fichero se implementa un cliente para poder usar con el servidor creado, usando la clase \hyperlink{class_socket}{Socket}. 

\subsection{Documentación de las funciones}
\hypertarget{client_8cpp_ab4a3d59d9d8c97b79cb3a6cb6a0e403c}{\index{client.\-cpp@{client.\-cpp}!connect@{connect}}
\index{connect@{connect}!client.cpp@{client.\-cpp}}
\subsubsection[{connect}]{\setlength{\rightskip}{0pt plus 5cm}bool connect (
\begin{DoxyParamCaption}
\item[{{\bf Socket} \&}]{s}
\end{DoxyParamCaption}
)}}\label{client_8cpp_ab4a3d59d9d8c97b79cb3a6cb6a0e403c}
\hypertarget{client_8cpp_a00a6f7afcba6bb656a7b05c67efa42ba}{\index{client.\-cpp@{client.\-cpp}!exit\-Client@{exit\-Client}}
\index{exit\-Client@{exit\-Client}!client.cpp@{client.\-cpp}}
\subsubsection[{exit\-Client}]{\setlength{\rightskip}{0pt plus 5cm}void exit\-Client (
\begin{DoxyParamCaption}
\item[{int}]{signal}
\end{DoxyParamCaption}
)}}\label{client_8cpp_a00a6f7afcba6bb656a7b05c67efa42ba}


Método para terminar el cliente. 

\begin{DoxyVerb}Este método se usa para terminar el cliente immediatamente en el caso que el servidor cierre la conexión de forma inesperada, capturando
\end{DoxyVerb}
 el signal S\-I\-G\-P\-I\-P\-E. 
\begin{DoxyParams}{Parámetros}
{\em signal} & Parámetro que captura el signal recibido \\
\hline
\end{DoxyParams}
\hypertarget{client_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4}{\index{client.\-cpp@{client.\-cpp}!main@{main}}
\index{main@{main}!client.cpp@{client.\-cpp}}
\subsubsection[{main}]{\setlength{\rightskip}{0pt plus 5cm}int main (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{client_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4}


Método principal del cliente. 

Este método inicializa el \hyperlink{class_socket}{Socket}, establece la conexión y realiza las acciones que se le hayan programado para comunicarse con el servidor. \hypertarget{client_8cpp_adce119cd6356a05c4703195cc608e17c}{\index{client.\-cpp@{client.\-cpp}!speed\-Test@{speed\-Test}}
\index{speed\-Test@{speed\-Test}!client.cpp@{client.\-cpp}}
\subsubsection[{speed\-Test}]{\setlength{\rightskip}{0pt plus 5cm}void speed\-Test (
\begin{DoxyParamCaption}
\item[{{\bf Socket} \&}]{s}
\end{DoxyParamCaption}
)}}\label{client_8cpp_adce119cd6356a05c4703195cc608e17c}


\subsection{Documentación de las variables}
\hypertarget{client_8cpp_ab36823025f12a809217f7771125658c2}{\index{client.\-cpp@{client.\-cpp}!connected@{connected}}
\index{connected@{connected}!client.cpp@{client.\-cpp}}
\subsubsection[{connected}]{\setlength{\rightskip}{0pt plus 5cm}bool connected}}\label{client_8cpp_ab36823025f12a809217f7771125658c2}
\hypertarget{client_8cpp_a9324389a5cdc532c6417a87ccafe18ce}{\index{client.\-cpp@{client.\-cpp}!finished@{finished}}
\index{finished@{finished}!client.cpp@{client.\-cpp}}
\subsubsection[{finished}]{\setlength{\rightskip}{0pt plus 5cm}bool finished}}\label{client_8cpp_a9324389a5cdc532c6417a87ccafe18ce}