Indy 9
TIdNNTPServer
Hierarchy, Properties, Methods, Events, See Also, Unit: IdNNTPServer
Implements an NNTP server framework.
TIdNNTPServer = class(TIdTCPServer)
Unit
IdNNTPServer
Description
TIdNNTPServer is a TIdTCPServer descendant that provides a framework for implementing a server based on the Network News Transfer Protocol (NNTP) as described in the Internet Standards documents:

  • RFC 977 - Network News Transfer Protocol (http://www.rfc-editor.org/rfc/rfc977.txt)

  • RFC 2980 - Common NNTP Extensions (http://www.rfc-editor.org/rfc/rfc2980.txt)

TIdNNTPServer is used for distributing messages publicly to central locations on a network. TIdNNTPServer is based on the formats, control messages, transmission methods, and propagtion algorithms defined in the Internet Standards document:

  • RFC 1036 - Standard for Interchange of USENET Messages (http://www.rfc-editor.org/rfc/rfc1036.txt)

TIdNNTPServer also incorporates the syntax for text-based messages as defined in the Internet Standards document:

  • RFC 2822 - Internet Message Format (http://www.rfc-editor.org/rfc/rfc2822.txt)

TIdNNTPServer provides a dual implementation capability, mirroring the options available in TIdTCPServer, using the TIdTCPServer.OnExecute event handler or through the use of the TIdCommandHandlers collection.

When using TIdCommandHandlers, TIdNNTPServer provides command event handlers to respond to the following NNTP commands and extensions:

  • ARTICLE

  • BODY

  • HEAD

  • STAT

  • GROUP

  • LIST

  • HELP

  • IHAVE

  • LAST

  • NEWGROUPS

  • NEWNEWS

  • NEXT

  • POST

  • QUIT

  • SLAVE

  • AUTHINFO

  • XOVER

  • XHDR

  • DATE

  • LISTGROUP

  • MODE

  • TAKETHIS

  • CHECK

  • XTHREAD

  • XGTITLE

  • XPAT

TIdNNTPServer also provides event handlers that allow implementation- dependent access to NNTP GRoups, Articles, and Overview database storage.


TIdNNTPServer.DefaultPort
TIdNNTPServer, See Also
Default port number for the server.
property DefaultPort: integer;
Description
DefaultPort is a published property in TIdNNTPServer that identifies the default port number for the server, as described in the Network News Transfer Protocol specification. The default value for DefaultPort is IdPORT_NNTP, as assigned in the TIdNNTPServer.Create constructor.

DefaultPort is the value used when the server creates a new listener thread for accepting client connections.


TIdNNTPServer.Help
TIdNNTPServer, See Also
Indicates NNTP commands supported in the server implementation.
property Help: TStrings;
Description
Help is TStrings property that contains the string values representing a short summary of commands that are understood by the NNTP server implementation. Help is presented as a textual response to the NNTP HELP command when CommandHandlers are used in the server implementation.

The Help property is allocated the Create constructor, and freed in the Destroy method. The NNTP server implementation must assign the string contents representing the supported NNTP commands prior to becoming Active.


TIdNNTPServer.OverviewFormat
TIdNNTPServer, See Also
Represents the message headers used in the NNTP overview database.
property OverviewFormat: TStrings;
Description
OverviewFormat is a TStrings property that represents the message headers to be used in responses to the NNTP XOVER command. OverviewFormat is initialized in the Create constructor, and contains the values as required by the NNTP RFCs:

  • Subject:

  • From:

  • Date:

  • Message-ID:

  • References:

  • Bytes:

  • Lines:

OverviewFormat is used during execution of the procedure assigned to CommandHandlers for the NNTP LIST OVERVIEW.FMT.

OverviewFormat is freed in the Destroy method.


TIdNNTPServer.Create
TIdNNTPServer, See Also
Creates a new TIdNNTPServer instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the instance.
Description
Create is the constructor for the TIdNNTPServer instance. Create relies on the inherited constructor to initialize the object instance, and sets the value of DefaultPort to IdPORT_NTTP (Decimal 119).

TIdNNTPServer.Destroy
TIdNNTPServer, See Also
Frees the object instance.
destructor Destroy; override;
Description
Destroy is the destructor for the object instance. Destroy frees and releases resources allocated in the Create constructor, including OverviewFormat and Help. Destroy calls the inherited Destroy method to finalize destruction of the object instance.

TIdNNTPServer.OnArticleByNo
TIdNNTPServer, See Also
Event handler signalled for the NNTP article retrieveal by message number.
property OnArticleByNo: TIdNNTPOnArticleByNo;
Description
OnArticleByNo is a TIdNNTPOnArticleByNo property that represents the event handler signalled when a threaded NNTP client connection requests an NNTP article. OnArticleByNo is used in conjunction with the OnCheckMsgNo event handler to locate, retrieve, and transmit the the contents of the requested NNTP article.

OnArticleByNo is signalled when the server implementation executes the command process for the CommandHandler assigned to the NNTP ARTICLE command. The server implementation must assign a procedure to the event handler to implement the platform and server specific algorithms required to respond to the NNTP command. The procedure for the event handler must send both the headers and the body for the NNTP article.


TIdNNTPServer.OnAuth
TIdNNTPServer
property OnAuth: TIdNNTPOnAuth;
Description
OnAuth

TIdNNTPServer.OnBodyByNo
TIdNNTPServer
property OnBodyByNo: TIdNNTPOnArticleByNo;
Description
OnBodyByNo

TIdNNTPServer.OnCheckListGroup
TIdNNTPServer
property OnCheckListGroup: TIdNNTPOnCheckListGroup;
Description
OnCheckListGroup

TIdNNTPServer.OnCheckMsgNo
TIdNNTPServer, See Also
Verifies message numbers and messgae identifers for articles on the NNTP server.
property OnCheckMsgNo: TIdNNTPOnCheckMsgNo;
Description
OnCheckMsgNo is a TIdNNTPOnCheckMsgNo property that represents the event handler signalled when a threaded NNTP client connection requests an NNTP article. OnCheckMsgNo is used in conjunction with the OnArticleByNo event handler to locate, retrieve, and transmit the the contents of the requested NNTP article.

OnCheckMsgNo is signalled when the server implementation executes the command process for CommandHandlers assigned to the NNTP ARTICLE command. The server implementation must assign a procedure to the event handler to implement the platform and server specific algorithms required to respond to the NNTP command. The procedure for the event handler must insure that an NNTP article exists having the requested message number or unique message identifier.


TIdNNTPServer.OnHeadByNo
TIdNNTPServer
property OnHeadByNo: TIdNNTPOnArticleByNo;
Description
OnHeadByNo

TIdNNTPServer.OnIHaveCheck
TIdNNTPServer
property OnIHaveCheck: TIdNNTPOnIHaveCheck;
Description
OnIHaveCheck

TIdNNTPServer.OnIHavePost
TIdNNTPServer
property OnIHavePost: TIdNNTPOnPost;
Description
OnIHavePost

TIdNNTPServer.OnListGroups
TIdNNTPServer, See Also
Generates a list of newsgroups with message and posting status information.
property OnListGroups: TIdServerThreadEvent;
Description
OnListGroups is a TIdServerThreadEvent property that represents the event handler signalled when a threaded NNTP client connection requests a listing of newsgroups a relevant group information on the NNTP server. OnListGroups is signalled when the server implementation executes the command procedure for CommandHandlers assigned to the NNTP LIST command.

The server implementation must assign a procedure to the event handler to implement the platform and server specific algorithms required to generate the listing of newsgroups with first, and last message numbers, as well as newsgroup posting status. The procedure for the event handler must write the response to the threaded client connection.


TIdNNTPServer.OnListNewGroups
TIdNNTPServer
property OnListNewGroups: TIdNNTPOnNewGroupsList;
Description
OnListNewGroups

TIdNNTPServer.OnNewNews
TIdNNTPServer
property OnNewNews: TIdNNTPOnNewNews;
Description
OnNewNews

TIdNNTPServer.OnNextArticle
TIdNNTPServer
property OnNextArticle: TIdNNTPOnMovePointer;
Description
OnNextArticle

TIdNNTPServer.OnPost
TIdNNTPServer, See Also
Implements receipt and storage of articles posted to the NNTP server.
property OnPost: TIdNNTPOnPost;
Description
OnPost is a TIdNNTPOnPost property that represents the event handl;er signalled when a threaded NNTP client connection attempts to post an article to the NNTP server. OnPost is signalled when executing the Command procedure assigned to the CommandHandlers for the NNTP POST command.

OnPost allows the server to implement the platform and server specific procedure and functions needed to receive and store an NNTP article. OnPost may also be used to set a status flag indicating posting is disallowed or failed for the article, as well as an error message associated with the abandoned post. OnPost must also perform receipt of the headers and body for the NNTP article using the threaded client connection, and storage in the format required for the server implementation.


TIdNNTPServer.OnPrevArticle
TIdNNTPServer
property OnPrevArticle: TIdNNTPOnMovePointer;
Description
OnPrevArticle

TIdNNTPServer.OnSelectGroup
TIdNNTPServer, See Also
Implements retrieval of newsgroup details for the specified newsgroup.
property OnSelectGroup: TIdNNTPOnSelectGroup;
Description
OnSelectGroup is a TIdNNTPOnSelectGroup property that represents the event handler used to perform the server- and platform-specific methods needed to get detailed newsgroup information. OnSelectGroup is signalled when a threaded NNTP client requests a list of articles for a specific newsgroup, and occurs during execution of the procedure assigned to CommandHandlers for the NNTP GROUP command.

OnSelectGroup accepts arguments that identify the newsgroup to be detailed, and returns values in the arguments that indicate the estimated total, first and last message numbers for the specified newsgroup. OnSelectGroup must also set the value for the argument indicating that the requested newsgroup exists on the server.

The server implementation must assign a procedure to the event handler to allow responding to the event notification. NOTE: OnSelectGroup does not need to format and write the NNTP GROUP response message; it is written in the CommandGroup procedure.


TIdNNTPServer.OnStatMsgNo
TIdNNTPServer
property OnStatMsgNo: TIdNNTPOnMovePointer;
Description
OnStatMsgNo

TIdNNTPServer.OnXHdr
TIdNNTPServer
property OnXHdr: TIdNNTPOnXHdr;
Description
OnXHdr

TIdNNTPServer.OnXOver
TIdNNTPServer, See Also
Implements listing article overview information in the NNTP server.
property OnXOver: TIdNNTPOnXOver;
Description
OnXOver is a TIdNNTPOnXOver property that represents the event handler used to implement retrieval of information from the overview database for specified or implied articles. OnXOver is signalled during execution of the procedure assigned to CommandHandlers for the NNTP XOVER command. The server implementation must assign a procedure to the event handler to allow responding the event notification.

OnXOver uses values from TIdNNTPThread to determine the current newsgroup, and current article pointer for the threaded client connection. A newsgroup must be selected before OnXOver can be used to retrieve overview information. If no NNTP article number is specified in the NNTP XOVER commmand, OnXOver is signalled with the current article pointer as the requested message number. OnXOver should updated the last message number argument to indicate the most recently posted article in the newsgroup.

OnXOver must generate a listing that consists of overview information for each message in the range requested. OnXOver must not contain overview information for deleted or removed articles. Each line in the listing must contain tab delimited values including the article number followed by message headers as indicated in the OverviewFormat property. Note: TAB and EOL characters in header data must be converted to a CHAR32 (Space) character.

OnXOver must write the contents of the listing to the threaded client connection. The NNTP response code and the trailing '.' character are handled by the protected CommandXOver procedure.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.