Aller au contenu principal

6. Exemple d'interaction

La nomenclature de la RFC 726 sera utilisée pour décrire cet exemple. Pour citer cette 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.

Le texte entre crochets ([]) est un commentaire. Le texte entre chevrons (<>) doit être pris comme une seule unité. Par exemple, le retour chariot est <cr>, et la valeur décimale 27 est représentée <27>.

Nous supposons que l'utilisateur a établi la connexion Telnet, s'est connecté, et qu'un programme d'application vient d'être lancé, soit directement par l'utilisateur, soit par une procédure de démarrage préenregistrée. La présentation sur la page vise simplement à regrouper les entités et n'implique pas la position des limites de messages. On doit supposer que n'importe quelle partie du dialogue peut être envoyée en un ou plusieurs messages. La première action du programme ou de Telnet est de négocier l'option 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>

L'échange précédent a placé à l'écran un formulaire qui ressemble à :

Name:
Address:

Telephone Number: Social Security Number:
"Your SSN will not be printed."

où la chaîne entre guillemets clignote.

L'utilisateur du terminal est maintenant libre de remplir le formulaire fourni. Il positionne le curseur au début du premier champ (ce qui se fait généralement en appuyant sur la touche tabulation) et commence à taper. Nous ne montrons pas cette interaction puisqu'elle ne génère aucune interaction avec le programme Telnet utilisateur ou le réseau. Une fois que l'utilisateur du terminal a fini de remplir le formulaire, il appuie sur la touche de transmission pour envoyer la partie non protégée du formulaire, mais auparavant le programme Telnet utilisateur négocie la Byte Macro Option pour condenser la sous-commande 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.

Et ainsi de suite.