14 NNTP: Newsgroup Protocol
The net/nntp module provides tools to access Usenet group via NNTP [RFC977].
14.1 Connection and Operations
| |||||
sender : output-port? | |||||
receiver : input-port? | |||||
server : string? | |||||
port : (integer-in 0 65535) |
Once a connection to a Usenet server has been established, its state is stored in a communicator, and other procedures take communicators as an argument.
(connect-to-server server [port-number]) → communicator? |
server : string? |
port-number : (integer-in 0 65535) = 119 |
Connects to server at port-number.
(disconnect-from-server communicator) → void? |
communicator : communicator? |
Disconnects an NNTP communicator.
(open-news-group communicator newsgroup) | |||||||
| |||||||
communicator : communicator? | |||||||
newsgroup : string? |
Selects the newsgroup of an NNTP connection. The returned values are the total number of articles in the group, the first available article, and the last available article.
| |||||||||||||||||||||
communicator : communicator? | |||||||||||||||||||||
username : string? | |||||||||||||||||||||
password : string? |
Tries to authenticate a user with the original authinfo command (uses cleartext). The password argument is ignored if the server does not ask for it.
| ||||||||||||||
communicator : communicator? | ||||||||||||||
message-index : exact-nonnegative-integer? |
Given a message number, returns its header lines.
| ||||||||||||||
communicator : communicator? | ||||||||||||||
message-index : exact-nonnegative-integer? |
Given a message number, returns the body of the message.
(newnews-since communicator message-index) → (listof string?) |
communicator : communicator? |
message-index : exact-nonnegative-integer? |
Implements the NEWNEWS command (often disabled on servers).
| ||||||||||||||||||||||||||||
command : string? | ||||||||||||||||||||||||||||
ok-code : exact-integer? | ||||||||||||||||||||||||||||
communicator : communicator? | ||||||||||||||||||||||||||||
message-index : exact-nonnegative-integer? |
Useful primitive for implementing head-of-message, body-of-message and other similar commands.
(make-desired-header tag-string) → regexp? |
tag-string : string? |
Takes a header field’s tag and returns a regexp to match the field
(extract-desired-headers header desireds) → (listof string?) |
Given a list of header lines and of desired regexps, returns the header lines that match any of the desireds.
14.2 Exceptions
|
The supertype of all NNTP exceptions.
| |||||
code : exact-integer? | |||||
text : string? |
Raised whenever an unexpected response code is received. The text field holds the response text sent by the server.
| |||||
line : string? |
Raised for mal-formed status lines.
| |||||
communicator : communicator? |
Raised when a remote server closes its connection unexpectedly.
| |||||
line : string? |
Raised when the newsgroup line is improperly formatted.
| |||||
group : string? |
Raised when the server does not recognize the name of the requested group.
| |||||
article : exact-integer? |
Raised when an article is outside the server’s range for that group.
|
Raised when an article operation is used before a group has been selected.
| |||||
article : exact-integer? |
Raised when the server is unable to locate the article.
|
Raised when the server reject an authentication attempt.
14.3 NNTP Unit
nntp@ : unit? |
Imports nothing, exports nntp^.
14.4 NNTP Signature
nntp^ : signature |
Includes everything exported by the net/nntp module.