server o viceversa, secondo lo schema illustrato in
fig.~\ref{fig:UDP_packet-exchange}.
-\begin{figure}[htb]
- \centering
- \includegraphics[width=10cm]{img/udp_connection}
+\begin{figure}[!htb]
+ \centering \includegraphics[width=10cm]{img/udp_connection}
\caption{Lo schema di interscambio dei pacchetti per una comunicazione via
UDP.}
\label{fig:UDP_packet-exchange}
UDP al server (di contenuto non specificato), il quale risponderà a inviando a
sua volta un pacchetto UDP contenente la data.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15.6cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/UDP_daytime.c}
\end{minipage}
\normalsize
pacchetto di richiesta ed inviare in risposta un pacchetto contenente una
stringa con la data corrente.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15.6cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/UDP_daytimed.c}
\end{minipage}
\normalsize
possono avere proviamo allora con un servizio leggermente più complesso come
\textit{echo}.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15.6cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/UDP_echo_first.c}
\end{minipage}
\normalsize
chiamata (\texttt{\small 28}) alla funzione \func{ClientEcho} che stavolta
però prende un argomento in più, che è l'indirizzo del socket.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15.6cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/UDP_ClientEcho_first.c}
\end{minipage}
\normalsize
riscrivere il nostro client per il servizio \textit{echo} con le modifiche
illustrate in fig.~\ref{fig:UDP_echo_conn_cli}.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15.6cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/UDP_echo.c}
\end{minipage}
\normalsize
\func{write} come illustrato dal nuovo codice riportato in
fig.~\ref{fig:UDP_echo_conn_echo_client}.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15.6cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/UDP_ClientEcho.c}
\end{minipage}
\normalsize