X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=othersock.tex;h=f04d9ae0b73b2b5474cc4705a8edbb28e73f2d94;hp=cd70d82d8d5cddb08fb7734b6bde9d936a8cd88d;hb=dcf2c2df897955ff3503a7c426025457ab456fd7;hpb=4cbeb0e4fa1d31da798c8e68108eb6785586ab34 diff --git a/othersock.tex b/othersock.tex index cd70d82..f04d9ae 100644 --- a/othersock.tex +++ b/othersock.tex @@ -1,6 +1,6 @@ %% othersock.tex %% -%% Copyright (C) 2004-2011 Simone Piccardi. Permission is granted to +%% Copyright (C) 2004-2012 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 "Un preambolo", @@ -70,8 +70,8 @@ fig.~\ref{fig:UDP_packet-exchange}. Come illustrato in fig.~\ref{fig:UDP_packet-exchange} la struttura generica di un server UDP prevede, una volta creato il socket, la chiamata a \func{bind} -per mettersi in ascolto dei dati. Questa è l'unica parte comune con un server -TCP: non essendovi il concetto di connessione le funzioni \func{listen} ed +per mettersi in ascolto dei dati, questa è l'unica parte comune con un server +TCP. Non essendovi il concetto di connessione le funzioni \func{listen} ed \func{accept} non sono mai utilizzate nel caso di server UDP. La ricezione dei dati dal client avviene attraverso la funzione \func{recvfrom}, mentre una eventuale risposta sarà inviata con la funzione \func{sendto}. @@ -231,7 +231,7 @@ suo prototipo\footnote{il prototipo è quello delle \acr{glibc} che seguono le \funcdecl{ssize\_t recvfrom(int sockfd, const void *buf, size\_t len, int flags, const struct sockaddr *from, socklen\_t *fromlen)} - Riceve un messaggio ad un socket. + Riceve un messaggio da un socket. \bodydesc{La funzione restituisce il numero di byte ricevuti in caso di successo e -1 in caso di errore; nel qual caso \var{errno} assumerà il