|
1
2
|
\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}}
|
|
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
}
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
|
|
21
22
23
|
bool \hyperlink{client_8cpp_ab4a3d59d9d8c97b79cb3a6cb6a0e403c}{connect} (\hyperlink{class_socket}{Socket} \&s)
\item
void \hyperlink{client_8cpp_adce119cd6356a05c4703195cc608e17c}{speed\-Test} (\hyperlink{class_socket}{Socket} \&s)
|
|
24
|
\item
|
|
25
26
|
int \hyperlink{client_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4}{main} ()
\begin{DoxyCompactList}\small\item\em Método principal del cliente. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
|
27
28
29
30
|
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item
bool \hyperlink{client_8cpp_ab36823025f12a809217f7771125658c2}{connected}
|
|
31
32
|
\item
bool \hyperlink{client_8cpp_a9324389a5cdc532c6417a87ccafe18ce}{finished}
|
|
33
|
\end{DoxyCompactItemize}
|
|
34
35
36
37
38
39
40
41
42
43
44
45
|
\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}
|
|
46
47
48
49
50
51
52
|
\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}
|
|
53
54
55
56
57
58
59
60
61
62
63
|
\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.
|
|
64
65
66
|
\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.
|
|
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
\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.
|
|
82
83
84
|
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 (
|
|
85
|
\begin{DoxyParamCaption}
|
|
86
|
\item[{{\bf Socket} \&}]{s}
|
|
87
|
\end{DoxyParamCaption}
|
|
88
|
)}}\label{client_8cpp_adce119cd6356a05c4703195cc608e17c}
|
|
89
90
91
92
93
94
|
\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}
|
|
95
96
97
|
\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}
|