6. Interazione di esempio
Per descrivere questo esempio verrà usata la nomenclatura della RFC 726. Citando tale RFC:
"S:" is sent from serving host to using host.
"U:" is sent from using host to serving host.
"T:" is entered by the terminal user.
"P:" is printed on the terminal.
Il testo racchiuso tra parentesi quadre ([]) è un commento. Il testo racchiuso tra parentesi angolari (<>) va inteso come un'unica unità. Ad esempio, il ritorno a capo è <cr> e il valore decimale 27 è rappresentato <27>.
Assumiamo che l'utente abbia stabilito la connessione Telnet, abbia effettuato l'accesso e che un programma applicativo sia appena stato avviato, direttamente dall'utente o tramite una procedura di avvio preconfezionata. La presentazione sulla pagina serve semplicemente a raggruppare le entità e non implica la posizione dei confini dei messaggi. Si deve assumere che qualsiasi parte del dialogo possa essere inviata come uno o molti messaggi. La prima azione del programma o di Telnet è negoziare l'opzione DET:
S: <IAC><DO><DET>
U: <IAC><WILL><DET>
S:<IAC><DO><OUTPUT PAGE SIZE> [First negotiate the screen
size. In this case we are
U:<IAC><WILL><NAOP> asking the user the size of the
terminal. This could have been
U:<IAC><SB><NAOP><DR><25><IAC><SE> done before the DET option was
negotiated.]
S:<IAC><SB><NAOP><DS><0><IAC><SE>
S:<IAC><DO><OUTPUT LINE WIDTH>
U:<IAC><SB><NAOL><DR><80><IAC><SE> [Defines the screen to be 25
lines by 80 characters.
S:<IAC><SB><NAOL><DS><0><IAC><SE> The server may use this
information when formatting
the screen.]
S:<IAC><SB><DET><FORMAT FACILITIES> [Now set the terminal attributes.]
<Repeat><Protection, 3 Levels
Intensity><IAC><SE>
U:<IAC><SB><DET><FORMAT FACILITIES>
<Repeat, Blinking><Protection, 3
Levels Intensity><IAC><SE>
S:<IAC><SB><DET><ERASE SCREEN><IAC><SE> [Erase the screen and
start sending the form.]
<IAC><SB><DET><FORMAT DATA>
<Protection=1, Intensity=1><0>
<5><IAC><SE>Name:
<IAC><SB><DET><MOVE CURSOR><0><1>
<IAC><SE>
<IAC><SB><DET><FORMAT DATA>
Protection=1, Intensity=1><0>
<8><IAC><SE>
Address:
<IAC><SB><MOVE CURSOR><0><4><IAC>
<SE>
<IAC><SB><DET><FORMAT DATA>
Protection=1, Intensity=1><0>
<17><IAC><SE>
Telephone number:
<IAC><SB><DET><MOVE CURSOR><32><4>
<IAC><SE>
<IAC><SB><DET><FORMAT DATA>
Protection=1, Intensity=1><0>
<24><IAC><SE>
Social Security Number:
<IAC><SB><DET><FORMAT DATA> [Establish a field that doesn't
<Protection=1, Intensity=7> display what is typed into it.]
<0><11><IAC><SE>
<IAC><SB><DET><MOVE CURSOR><32>
<5><IAC><SE>
<IAC><SB><DET><FORMAT FACILITIES> [Get permission to use Blinking
<Blinking><0><IAC><SE> Attribute.]
U:<IAC><SB><DET><FORMAT FACILITIES>
<Repeat, Blinking><Protection,
3 Levels Intensity><IAC><SE>
S:<IAC><SB><DET><FORMAT DATA>
<Blinking=1, Protection=1,
Intensity=1><0><29><IAC><SE>
Your SSN will not be printed.
<IAC><SB><DET><HOME><IAC><SE>
<IAC><GA>
Lo scambio precedente ha posizionato sullo schermo un modulo che appare così:
Name:
Address:
Telephone Number: Social Security Number:
"Your SSN will not be printed."
dove la stringa tra virgolette lampeggia.
L'utente del terminale è ora libero di compilare il modulo fornito. Posiziona il cursore all'inizio del primo campo (di solito premendo il tasto tab) e inizia a digitare. Non mostriamo questa interazione poiché non genera alcuna interazione con il programma User Telnet o con la rete. Dopo che l'utente del terminale ha finito di compilare il modulo, preme il tasto di trasmissione per inviare la parte non protetta del modulo, ma prima il programma User Telnet negozia la Byte Macro Option per condensare il sottocomando Field Separator:
U:<IAC><DO><BM> [Negotiate Byte Macro Option.]
S:<IAC><WILL><BM> [Define decimal 166 to be the
Field Separator subcommand
U:<IAC><SB><BM><DEFINE> (see Appendix 3)]
<166><6><IAC SB DET FIELD
SEPARATOR IAC SE><IAC><SE>
S:<IAC><SB><BM><ACCEPT><166> [The server accepts the macro.]
<IAC><SE>
U:<IAC><SB><DET><DATA TRANSMIT><0><6>
<IAC><SE>
John Doe <166> 1515 Elm St., Urbana, Il 61801
<166> 217-333-9999 <166> 123-45-6789 <166>
S:<IAC><SB><DET><ERASE SCREEN><IAC><SE>
Thank you.
E così via.