NNTP Class
Properties Methods Events Configuration Settings Errors
The NNTP Component is used to read, search, and post articles on Usenet news servers.
Class Name
IPWorks_NNTP
Procedural Interface
ipworks_nntp_open(); ipworks_nntp_close($res); ipworks_nntp_register_callback($res, $id, $function); ipworks_nntp_get_last_error($res); ipworks_nntp_get_last_error_code($res); ipworks_nntp_set($res, $id, $index, $value); ipworks_nntp_get($res, $id, $index); ipworks_nntp_do_config($res, $configurationstring); ipworks_nntp_do_connect($res); ipworks_nntp_do_disconnect($res); ipworks_nntp_do_doevents($res); ipworks_nntp_do_fetcharticle($res); ipworks_nntp_do_fetcharticlebody($res); ipworks_nntp_do_fetcharticleheaders($res); ipworks_nntp_do_groupoverview($res); ipworks_nntp_do_groupsearch($res); ipworks_nntp_do_interrupt($res); ipworks_nntp_do_listgroups($res); ipworks_nntp_do_listnewgroups($res); ipworks_nntp_do_localizedate($res, $datetime); ipworks_nntp_do_postarticle($res); ipworks_nntp_do_resetheaders($res);
Remarks
The NNTP Class implements a standard Usenet news reader as specified in RFC 977. It can be used to browse Usenet news groups and read and post articles.
The CurrentGroup property sets the current newsgroup. From then on, news articles from that group can be read by setting the article number in CurrentArticle and then calling the appropriate method. Properties such as ArticleCount, FirstArticle, LastArticle provide information about the current state.
The headers and text of the articles are received respectively through the Header and Transfer events. Additionally, up to MaxLines from the article body are provided in the ArticleText property. The GroupOverview event returns information about a range of articles (OverviewRange) in CurrentGroup, and the GroupList event is used when listing newsgroup names. The PITrail event provides a trace of the interaction with the server.
The class supports posting of articles through the ArticleText and AttachedFile properties. The article text is specified in one or both of the above, and then the PostArticle method is called. Article headers are given in a series of properties like ArticleFrom, ArticleSubject, Organization, etc. that map directly to the USENET article header with the same name.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
ArticleCount | The estimated number of articles in CurrentGroup . |
ArticleDate | The date of the current article. |
ArticleFrom | The email address of the author (for posting articles). |
ArticleHeaders | The full headers of the article as retrieved from the server. |
ArticleId | The message identifier of the current article. |
GroupOverviewCount | The number of records in the GroupOverview arrays. |
GroupOverviewArticleLines | The number of lines of an article in a newsgroup overview. |
GroupOverviewArticleNumber | The number of an article in a newsgroup overview. |
GroupOverviewArticleSize | The size of an article in a newsgroup overview. |
GroupOverviewDate | The date of an article in a newsgroup overview. |
GroupOverviewFrom | The sender of an article in a newsgroup overview. |
GroupOverviewMessageId | The unique message id of an article in a newsgroup overview. |
GroupOverviewOtherHeaders | The remaining headers of an article in a newsgroup overview. |
GroupOverviewReferences | The references of an article in a newsgroup overview. |
GroupOverviewSubject | The subject of an article in a newsgroup overview. |
ArticleReferences | Articles to which the posted article follows up. |
ArticleReplyTo | The address to reply to (for posting articles). |
ArticleSubject | The article subject (for posted articles). |
ArticleText | The full text of the article (without the headers). |
AttachedFile | A file name which the contents of will be appended to the ArticleText when posting articles. |
CheckDate | The date (format YYMMDD HHMMSS) to check for creation of new groups. If the group was created after the date specified, it is considered new. |
Command | Used to send additional commands directly to the server. |
Connected | Shows whether the component is connected. |
CurrentArticle | The number or message identifier of the current article. |
CurrentGroup | The name of the current group. |
FirewallAutoDetect | This property tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallType | This property determines the type of firewall to connect through. |
FirewallHost | This property contains the name or IP address of firewall (optional). |
FirewallPassword | This property contains a password if authentication is to be used when connecting through the firewall. |
FirewallPort | This property contains the TCP port for the firewall Host . |
FirewallUser | This property contains a user name if authentication is to be used connecting through a firewall. |
FirstArticle | The number of the first article in CurrentGroup . |
GroupListCount | The number of records in the GroupList arrays. |
GroupListCanPost | This property indicates whether a group in a newsgroup listing allows postings or articles. |
GroupListFirstArticle | This property shows the first available article in a newsgroup listing. |
GroupListGroup | This property shows the group name in a newsgroup listing. |
GroupListLastArticle | This property shows the last available article in a newsgroup listing. |
Idle | The current status of the component. |
LastArticle | The number of the last article in CurrentGroup . |
LastReply | The last reply from the server. |
LocalFile | The path to a local file for downloading the article body. If the file exists, it is overwritten (optional). |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
MaxLines | The maximum number of message lines aside from headers to retrieve. |
Newsgroups | A comma separated list of newsgroups in which to post the article. |
NewsPort | The server port for NNTP (default 119). |
NewsServer | The name or address of a news server. |
Organization | The organization of the author (for posting articles). |
OtherHeaders | An RFC850 compliant string consisting of extra headers (for posting articles). |
OverviewRange | A range for the GroupOverview method (first-last). |
ParsedHeaderCount | The number of records in the ParsedHeader arrays. |
ParsedHeaderField | This property contains the name of the HTTP header (same case as it is delivered). |
ParsedHeaderValue | This property contains the header contents. |
Password | A logon password for the NewsServer . |
SearchHeader | A header for the GroupSearch method. |
SearchPattern | A search pattern for the GroupSearch method. |
SearchRange | A range for the GroupSearch method (first-last). |
Timeout | A timeout for the component. |
User | A user identifier to login as in the NewsServer . |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting . |
Connect | Connects to the news server. |
Disconnect | Disconnects from the news server. |
DoEvents | Processes events from the internal message queue. |
FetchArticle | Get the headers and body of an article specified in CurrentArticle . |
FetchArticleBody | Gets only the body of an article specified in CurrentArticle . |
FetchArticleHeaders | Gets only the headers of an article specified in CurrentArticle . |
GroupOverview | Receives an overview for the articles in range OverviewRange in the CurrentGroup . |
GroupSearch | Receives an overview for the articles in range SearchRange in the CurrentGroup . |
Interrupt | Interrupt the current method. |
ListGroups | Lists all groups on the server. |
ListNewGroups | Lists all new groups on the server. |
LocalizeDate | Converts a valid RFC 822 message date to local date and time. |
PostArticle | Posts the current article and attached file. |
ResetHeaders | Resets all of the article headers. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
ConnectionStatus | Fired to indicate changes in connection state. |
EndTransfer | Fired when the article text completes transferring. |
Error | Information about errors during data delivery. |
GroupList | Fired while group data transfers (during group listings). |
GroupOverview | Fired for each line of article overview data (during group overviews). |
GroupSearch | Fired for each line of group search data (during group searches). |
Header | Fired for every article header being retrieved during article retrieval. |
PITrail | Traces the commands sent to the news server, and the respective replies. |
StartTransfer | Fired when the article text starts transferring. |
Transfer | Fired while the article text gets transferred (to or from the NewsServer ). |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
ArticleInfoLimit | Instructs component to save the amount of articles specified that are returned by the server when a GroupOverview event is fired. |
GroupInfoLimit | Instructs component to save the amount of group info objects specified that are returned by the server after a ListGroups call has been made. |
MaxHeaderLength | Maximum length for headers to avoid line folding (default 80). |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The TCP port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
RecordLength | The length of received data records. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
UseIPv6 | Whether to use IPv6. |
TcpNoDelay | Whether or not to delay when sending packets. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
CodePage | The system code page used for Unicode to Multibyte translations. |