4. Conversazioni di esempio
Questi sono esempi delle conversazioni che ci si potrebbe aspettare con il server di news in sessioni ipotetiche. La notazione C: indica i comandi inviati al server di news dal programma client; S: indica le risposte ricevute dal client dal server.
4.1. Esempio 1 - accesso relativo con NEXT
S: (listens at TCP port 119)
C: (requests connection on TCP port 119)
S: 200 wombatvax news server ready - posting ok
(client asks for a current newsgroup list)
C: LIST
S: 215 list of newsgroups follows
S: net.wombats 00543 00501 y
S: net.unix-wizards 10125 10011 y
(more information here)
S: net.idiots 00100 00001 n
S: .
(client selects a newsgroup)
C: GROUP net.unix-wizards
S: 211 104 10011 10125 net.unix-wizards group selected
(there are 104 articles on file, from 10011 to 10125)
(client selects an article to read)
C: STAT 10110
S: 223 10110 <[email protected]> article retrieved - statistics
only (article 10110 selected, its message-id is
<[email protected]>)
(client examines the header)
C: HEAD
S: 221 10110 <[email protected]> article retrieved - head
follows (text of the header appears here)
S: .
(client wants to see the text body of the article)
C: BODY
S: 222 10110 <[email protected]> article retrieved - body
follows (body text here)
S: .
(client selects next article in group)
C: NEXT
S: 223 10113 <[email protected]> article retrieved - statistics
only (article 10113 was next in group)
(client finishes session)
C: QUIT
S: 205 goodbye.
4.2. Esempio 2 - accesso assoluto agli articoli con ARTICLE
S: (listens at TCP port 119)
C: (requests connection on TCP port 119)
S: 201 UCB-VAX netnews server ready -- no posting allowed
C: GROUP msgs
S: 211 103 402 504 msgs Your new group is msgs
(there are 103 articles, from 402 to 504)
C: ARTICLE 401
S: 423 No such article in this newsgroup
C: ARTICLE 402
S: 220 402 <[email protected]> Article retrieved, text follows
S: (article header and body follow)
S: .
C: HEAD 403
S: 221 403 <[email protected]> Article retrieved, header follows
S: (article header follows)
S: .
C: QUIT
S: 205 UCB-VAX news server closing connection. Goodbye.
4.3. Esempio 3 - il comando NEWGROUPS
S: (listens at TCP port 119)
C: (requests connection on TCP port 119)
S: 200 Imaginary Institute News Server ready (posting ok)
(client asks for new newsgroups since April 3, 1985)
C: NEWGROUPS 850403 020000
S: 231 New newsgroups since 03/04/85 02:00:00 follow
S: net.music.gdead
S: net.games.sources
S: .
C: GROUP net.music.gdead
S: 211 0 1 1 net.music.gdead Newsgroup selected
(there are no articles in that newsgroup, and
the first and last article numbers should be ignored)
C: QUIT
S: 205 Imaginary Institute news server ceasing service. Bye!
4.4. Esempio 4 - invio di un articolo di news
S: (listens at TCP port 119)
C: (requests connection on TCP port 119)
S: 200 BANZAIVAX news server ready, posting allowed.
C: POST
S: 340 Continue posting; Period on a line by itself to end
C: (transmits news article in RFC850 format)
C: .
S: 240 Article posted successfully.
C: QUIT
S: 205 BANZAIVAX closing connection. Goodbye.
4.5. Esempio 5 - interruzione per richiesta dell'operatore
S: (listens at TCP port 119)
C: (requests connection on TCP port 119)
S: 201 genericvax news server ready, no posting allowed.
(assume normal conversation for some time, and
that a newsgroup has been selected)
C: NEXT
S: 223 1013 <[email protected]> Article retrieved; text separate.
C: HEAD
C: 221 1013 <[email protected]> Article retrieved; head follows.
S: (sends head of article, but halfway through is
interrupted by an operator request. The following
then occurs, without client intervention.)
S: (ends current line with a CR-LF pair)
S: .
S: 400 Connection closed by operator. Goodbye.
S: (closes connection)
4.6. Esempio 6 - uso del server di news per distribuire news tra sistemi
S: (listens at TCP port 119)
C: (requests connection on TCP port 119)
S: 201 Foobar NNTP server ready (no posting)
(client asks for new newsgroups since 2 am, May 15, 1985)
C: NEWGROUPS 850515 020000
S: 235 New newsgroups since 850515 follow
S: net.fluff
S: net.lint
S: .
(client asks for new news articles since 2 am, May 15, 1985)
C: NEWNEWS * 850515 020000
S: 230 New news since 850515 020000 follows
S: <[email protected]>
S: <[email protected]>
S: <[email protected]>
S: .
(client asks for article <[email protected]>)
C: ARTICLE <[email protected]>
S: 220 <[email protected]> All of article follows
S: (sends entire message)
S: .
(client asks for article <[email protected]>
C: ARTICLE <[email protected]>
S: 220 <[email protected]> All of article follows
S: (sends entire message)
S: .
(client asks for article <[email protected]>
C: ARTICLE <[email protected]>
S: 220 <[email protected]> All of article follows
S: (sends entire message)
S: .
(client offers an article it has received recently)
C: IHAVE <[email protected]>
S: 435 Already seen that one, where you been?
(client offers another article)
C: IHAVE <[email protected]>
S: 335 News to me! <CRLF.CRLF> to end.
C: (sends article)
C: .
S: 235 Article transferred successfully. Thanks.
(or)
S: 436 Transfer failed.
(client is all through with the session)
C: QUIT
S: 205 Foobar NNTP server bids you farewell.