Now we have connected to the server to talk to the server through the socket we opened earlier. For example, we want to get the last 10 articles from a news group. RFC977 pointed out that the first step is to use the GROUP command to select the correct Newsgroup: the GROUPggg parameter is the name of the newsgroup to be selected (for example, net. news), which is required. Dialog with the server
Now that we have connected to the server, we can talk to the server through the socket opened previously. For example, we want to get the last 10 articles from a news group. RFC977 indicates that the first step is to use the GROUP command to select the correct Newsgroup:
GROUP ggg
The ggg parameter is the name of the newsgroup to be selected (for example, "net. news"), which is required. You can use the LIST command to obtain the LIST of available newsgroups. After the newsgroup command is selected, the number of the first and last articles in the group and the number of articles in the group are returned.
The following is an example:
Chrome :~ $ Telnet my. news. host 119
Trying aa. bb. cc. dd...
Connected to my. news. host.
Escape character is '^]'.
200 my. news. host InterNetNews NNRP server INN 2.2.2 13-Dec-1999 ready (posting OK ).
GROUP alt. test
211 232 222996 223235 alt. test
Quit
205.
After receiving the command GROUP alt. test, the server returns "211 232 222996 223235 alt. test". 211, which is the return code defined in RFC, indicating that the command has been successfully executed. The returned information also indicates that there are currently 232 articles. The first article number is 222996, and the latest article number is 223235. We can see that 222996 232 is not equal to 223235. The 7 lost articles were deleted from the server for some reason, probably because they were canceled by its legal author (this is possible and easy to do ), or, it is deleted because it is a sprinkling article.
Note that some servers may require authentication before selecting a newsgroup, depending on whether it is a public or private server. It is also possible that the server allows anyone to read articles, but the post requires authentication.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.