Inizio della revisione del formato per la suddivisione in due parti,
[gapil.git] / sockctrl.tex
index 82c559705568f885192e936dc377bea776fab675..51e489c9ec7c1e0a78adc4c3599dea71e985d9a9 100644 (file)
@@ -48,9 +48,8 @@ server che forniscono su internet questo servizio, mentre nel nostro caso
 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}
@@ -650,7 +649,7 @@ definizione è riportata in fig.~\ref{fig:sock_hostent_struct}.
 
 \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
@@ -716,9 +715,9 @@ che dovrà essere utilizzata nei risultati restituiti dalla funzione. Per tutto
 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
@@ -1107,7 +1106,7 @@ quindi la funzione non è \index{funzioni!rientranti} rientrante.
 
 \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
@@ -1273,7 +1272,7 @@ tipo \struct{addrinfo} contenenti tutte le informazioni ottenute.
 
 \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
@@ -1490,9 +1489,9 @@ dell'argomento \var{hints} per restringere le ricerche su protocolli, tipi di
 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
@@ -1694,9 +1693,9 @@ fig.~\ref{fig:sockconn_code}, il codice completo è nel file \file{SockUtil.c}
 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
@@ -1755,9 +1754,9 @@ ritornata contiene indirizzi IPv6 o IPv4, in quanto si fa uso direttamente dei
 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
@@ -1776,9 +1775,9 @@ codice completo è nel file \file{TCP\_echo\_fifth.c} dei sorgenti allegati)
 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
@@ -1824,9 +1823,9 @@ ha successo il programma deve uscire immediatamente prima di essere posto in
 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
@@ -2416,9 +2415,9 @@ attesa di dati in ingresso su una connessione che non arriveranno mai o perché
 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
@@ -2514,9 +2513,9 @@ completo della funzione si trova, insieme alle altre funzioni di servizio dei
 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
@@ -2548,9 +2547,9 @@ riportata in fig.~\ref{fig:TCP_echod_fifth}) se ne potrà impostare ad 1 il
 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
@@ -2649,7 +2648,7 @@ dal kernel.
 
 \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
@@ -2683,9 +2682,9 @@ fig.~\ref{fig:TCP_echo_sixth} la sezione di codice che permette di introdurre
 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
@@ -2825,7 +2824,7 @@ seguente elenco:
 
 \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
@@ -3056,7 +3055,7 @@ sez.~\ref{sec:net_sendmsg}).
 
 \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
@@ -3339,7 +3338,7 @@ quantità di dettagli è fornita nel seguente elenco:
 
 \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
@@ -3362,9 +3361,9 @@ quantità di dettagli è fornita nel seguente elenco:
   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
@@ -3629,7 +3628,7 @@ permette di impostare e rilevare le funzionalità delle interfacce di rete.
 
 \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
@@ -3778,7 +3777,7 @@ sono le seguenti:
 
 \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
@@ -3830,7 +3829,7 @@ fig.~\ref{fig:netdevice_ifconf_struct}.
 
 \begin{figure}[!htb]
   \footnotesize \centering
-  \begin{minipage}[c]{15cm}
+  \begin{minipage}[c]{\textwidth}
     \includestruct{listati/ifconf.h}
   \end{minipage}
   \caption{La struttura \structd{ifconf}.}
@@ -3864,9 +3863,9 @@ probabilmente\footnote{probabilmente perché si potrebbe essere nella
   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}.}