X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=simpltcp.tex;h=dab0667152882f122c87f82d7ce287189515377b;hp=b9d99e64afb8a46e54fa97de01dc9a66771fd6b3;hb=9c3be0a6a901fad667ba1abcd8b46c712020cf26;hpb=247c7ba624f39b283f9e85816c0616348f39c1b6 diff --git a/simpltcp.tex b/simpltcp.tex index b9d99e6..dab0667 100644 --- a/simpltcp.tex +++ b/simpltcp.tex @@ -1,3 +1,13 @@ +%% simpltcp.tex +%% +%% Copyright (C) 2000-2002 Simone Piccardi. Permission is granted to +%% copy, distribute and/or modify this document under the terms of the GNU Free +%% Documentation License, Version 1.1 or any later version published by the +%% Free Software Foundation; with the Invariant Sections being "Prefazione", +%% with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the +%% license is included in the section entitled "GNU Free Documentation +%% License". +%% \chapter{Un esempio completo di client/server TCP} \label{cha:simple_TCP_sock} @@ -121,14 +131,15 @@ alla funzione \code{ServEcho}. % processo figlio, il quale si incarica di lanciare la funzione % \texttt{SockEcho}. -Il codice della funzione \code{ServEcho} è invece mostrata in \nfig, la -comunicazione viene gestita all'interno del ciclo (linee \texttt{\small - 6--8}). I dati inviati dal client vengono letti dal socket con una semplice -\func{read} (che ritorna solo in presenza di dati in arrivo), la riscrittura -viene invece gestita dalla funzione \func{SockWrite} (descritta in -\figref{fig:sock_SockWrite_code}) che si incarica di tenere conto -automaticamente della possibilità che non tutti i dati di cui è richiesta la -scrittura vengano trasmessi con una singola \func{write}. +Il codice della funzione \code{ServEcho} è invece mostrata in +\figref{fig:TCPsimpl_server_elem_sub}, la comunicazione viene gestita +all'interno del ciclo (linee \texttt{\small 6--8}). I dati inviati dal client +vengono letti dal socket con una semplice \func{read} (che ritorna solo in +presenza di dati in arrivo), la riscrittura viene invece gestita dalla +funzione \func{SockWrite} (descritta in \figref{fig:sock_SockWrite_code}) che +si incarica di tenere conto automaticamente della possibilità che non tutti i +dati di cui è richiesta la scrittura vengano trasmessi con una singola +\func{write}. \begin{figure}[!htb] \footnotesize