affronteremo la problematica dal lato client, di un qualunque programma che
necessita di compiere questa operazione.
-\begin{figure}[htb]
- \centering
- \includegraphics[width=11cm]{img/resolver}
+\begin{figure}[!htb]
+ \centering \includegraphics[width=11cm]{img/resolver}
\caption{Schema di funzionamento delle funzioni del \textit{resolver}.}
\label{fig:sock_resolver_schema}
\end{figure}
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/hostent.h}
\end{minipage}
\caption{La struttura \structd{hostent} per la risoluzione dei nomi a
il resto la funzione è identica a \func{gethostbyname}, ed identici sono i
suoi risultati.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/mygethost.c}
\end{minipage}
\normalsize
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/servent.h}
\end{minipage}
\caption{La struttura \structd{servent} per la risoluzione dei nomi dei
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/addrinfo.h}
\end{minipage}
\caption{La struttura \structd{addrinfo} usata nella nuova interfaccia POSIX
socket o famiglie di indirizzi, è disponibile nel file \texttt{mygetaddr.c}
dei sorgenti allegati alla guida.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/mygetaddr.c}
\end{minipage}
\normalsize
dei sorgenti allegati alla guida, che contiene varie funzioni di utilità per
l'uso dei socket.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/sockconn.c}
\end{minipage}
\normalsize
dati relativi alle strutture degli indirizzi di \struct{addrinfo} che sono
\textsl{opachi} rispetto all'uso della funzione \func{connect}.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/TCP_echo_fifth.c}
\end{minipage}
\normalsize
consente di utilizzare come argomento del programma un nome a dominio al posto
dell'indirizzo numerico, e può utilizzare sia indirizzi IPv4 che IPv6.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/sockbind.c}
\end{minipage}
\normalsize
background, e può quindi scrivere gli errori direttamente sullo standard
error.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/TCP_echod_third.c}
\end{minipage}
\normalsize
il client sull'altro capo non è più attivo o perché non è più in grado di
comunicare con il server via rete.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/TCP_echod_fourth.c}
\end{minipage}
\normalsize
socket, all'interno del file \texttt{SockUtils.c} dei sorgenti allegati alla
guida.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/sockbindopt.c}
\end{minipage}
\normalsize
valore, per cui in tal caso la successiva chiamata (\texttt{\small 13-17}) a
\func{setsockopt} attiverà l'opzione \const{SO\_REUSEADDR}.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/TCP_echod_fifth.c}
\end{minipage}
\normalsize
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/linger.h}
\end{minipage}
\caption{La struttura \structd{linger} richiesta come valore dell'argomento
questa funzionalità,; al solito il codice completo è disponibile nei sorgenti
allegati.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/TCP_echo_sixth.c}
\end{minipage}
\normalsize
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/pktinfo.h}
\end{minipage}
\caption{La struttura \structd{pktinfo} usata dall'opzione
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/ip_mreqn.h}
\end{minipage}
\caption{La struttura \structd{ip\_mreqn} utilizzata dalle opzioni dei
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/tcp_info.h}
\end{minipage}
\caption{La struttura \structd{tcp\_info} contenente le informazioni sul
in fig.~\ref{fig:is_closing}, in cui si utilizza il valore del campo
\var{tcpi\_state} di \struct{tcp\_info} per controllare lo stato del socket.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/is_closing.c}
\end{minipage}
\caption{Codice della funzione \texttt{is\_closing.c}, che controlla lo stato
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/ifreq.h}
\end{minipage}
\caption{La struttura \structd{ifreq} utilizzata dalle \func{ioctl} per le
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/ifmap.h}
\end{minipage}
\caption{La struttura \structd{ifmap} utilizzata per leggere ed impostare i
\begin{figure}[!htb]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\textwidth}
\includestruct{listati/ifconf.h}
\end{minipage}
\caption{La struttura \structd{ifconf}.}
condizione in cui sono stati usati esattamente quel numero di byte.} avuta
una situazione di troncamento dei dati.
-\begin{figure}[!htb]
+\begin{figure}[!htbp]
\footnotesize \centering
- \begin{minipage}[c]{15cm}
+ \begin{minipage}[c]{\codesamplewidth}
\includecodesample{listati/iflist.c}
\end{minipage}
\caption{Il corpo principale del programma \texttt{iflist.c}.}