home *** CD-ROM | disk | FTP | other *** search
- NewsBase clients
- ----------------
-
- This file contains some notes about how a NewsBase client might interact
- with NewsBase.
-
- Startup.
- --------
-
- On startup, the client should broadcast NewsBase_Command 0 (Startup). If
- newsbase is running, it will reply with NewsBase_Reply 0, from which the
- client can obtain the newsbase task handle for future communication. If no
- reply is received, the client might want to either complain to the user, or
- attempt to start newsbase itself.
-
- If newsbase terminates due to an error condition or user request, it
- broadcasts NewsBase_Reply 10 (shutdown), so that any clients can take
- appropriate action.
-
- NewsBase also broadcasts NewsBase_Reply 0 (startup) when first started, so
- that already-running clients may be aware of this.
-
- When a client has started, and established communication with NewsBase, it
- may wish to obtain site-specific data using NewsBase_Command 30. As a
- minimum, it should probably obtain the hostname. This data is optional, and
- provided to avoid the user to have to configure the same information in the
- client as well as other programs (NewsBase and the transport itself).
-
- Groups
- ------
-
- A list all of active groups may be obtained by sending NewsBase_Command 100
- (ListGroups). NewsBase responds with a stream of NewsBase_Reply 100
- messages, containing groupnames matching the given pattern ("*" to match
- all), one message per group. The list is terminated with a message
- containing a null groupname.
-
- Each groupname message also contains the numbers of the lowest and highest
- article numbers in the group. This may be taken as guidance of how many
- articles are present, and whether there is unread news in the group for a
- user.
-
- NewsBase reply messages differ from many wimp messages in that idle
- wimp_polls may occur between a command being sent and the reply being
- receieved; or during a stream of replies. the client thus has to make some
- effort to track the current command, and which command the replies apply to
- (though this should be simple, as commands are not allowed to "overlap").
-
- Articles
- --------
-
- A list of article data for agroup may be obtained using NewsBase_Command 200
- (ListArts). A sequence of Newsbase_Reply messages, containing article
- number, from and subject data, are returned, one per article.
-
- An individual article may be retrieved using NewsBase_Command 220
- (GetArticle). A message NewsBase_Reply 220 is returned, containing the name
- of the file. If the file is not found or available, a NewsBase_Reply 221 is
- returned.
-
- It should be noted that an article number may be returned by ListArts but
- not found by GetArticle... the ListArts data comes from the group index
- file, which does not guarantee availablilty of the actual file (though this
- should be rare, it could occur if an article is requested during an expiry
- operation).
-
- Posting or Emailing.
-
- A file containing a fully-formatted article or mail message, including
- RFC-compliant headers, should be generated. The filename should ten be
- passed in a NewsBase_Command 300 or 310 message. A newsBase_Reply 300 or 310
- message will be returned to indicate success, or 301/311 (including an error
- message) for failure.
-
- NewsBase_Update messages
- ------------------------
-
- These messages are broadcast during a debatch or expiry, to indicate that
- new articles or groups have been created or deleted. A client may either
- want to use these messages explicitly to update article lists and displays
- in realtime (Readnews-style), or may simply wish to note that a group has
- changed, and perform a rescan (ListGroups or ListArts) later.
-
- In other words, the client can treat this message as it wishes, or even
- ignore it.
-
- Default Client
- --------------
-
- Client programs may define a variable as follows in their !Boot file:
-
- set NewsBase$ClientXXXX <Obey$Dir>
-
- (for example, NewsBase$ClientTTFN)
-
- Newsbase uses these variables to present clients to the user in the Newsbase
- General Setup "Default Client" menu.
-