NNTP Class

Properties   Methods   Events   Configuration Settings   Errors  

The NNTP Class is used to read, search, and post articles on Usenet news servers.

Syntax

IPWorksNNTP
IPWorksNNTPSwift

Remarks

The NNTP Class supports both plaintext and SSL/TLS connections. When connecting over SSL/TLS the SSLServerAuthentication event allows you to check the server identity and other security attributes. The SSLStatus event provides information about the SSL handshake. Additional SSL related settings are also supported via the Config method.

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.

- articleCountThe estimated number of articles in CurrentGroup .
- articleDateThe date of the current article.
- articleFromThe email address of the author (for posting articles).
- articleHeadersThe full headers of the article as retrieved from the server.
- articleIdThe message identifier of the current article.
- groupOverviewCountThe number of records in the GroupOverview arrays.
- groupOverviewArticleLines:(int)groupOverviewIndexThe number of lines of an article in a newsgroup overview.
- groupOverviewArticleNumber:(int)groupOverviewIndexThe number of an article in a newsgroup overview.
- groupOverviewArticleSize:(int)groupOverviewIndexThe size of an article in a newsgroup overview.
- groupOverviewDate:(int)groupOverviewIndexThe date of an article in a newsgroup overview.
- groupOverviewFrom:(int)groupOverviewIndexThe sender of an article in a newsgroup overview.
- groupOverviewMessageId:(int)groupOverviewIndexThe unique message id of an article in a newsgroup overview.
- groupOverviewOtherHeaders:(int)groupOverviewIndexThe remaining headers of an article in a newsgroup overview.
- groupOverviewReferences:(int)groupOverviewIndexThe references of an article in a newsgroup overview.
- groupOverviewSubject:(int)groupOverviewIndexThe subject of an article in a newsgroup overview.
- articleReferencesArticles to which the posted article follows up.
- articleReplyToThe address to reply to (for posting articles).
- articleSubjectThe article subject (for posted articles).
- articleTextThe full text of the article (without the headers).
- attachedFileA file name which the contents of will be appended to the ArticleText when posting articles.
- checkDateThe date (format YYMMDD HHMMSS) to check for creation of new groups. If the group was created after the date specified, it is considered new.
- commandUsed to send additional commands directly to the server.
- connectedShows whether the class is connected.
- currentArticleThe number or message identifier of the current article.
- currentGroupThe name of the current group.
- firewallAutoDetectThis property tells the class whether or not to automatically detect and use firewall system settings, if available.
- firewallTypeThis property determines the type of firewall to connect through.
- firewallHostThis property contains the name or IP address of firewall (optional).
- firewallPasswordThis property contains a password if authentication is to be used when connecting through the firewall.
- firewallPortThis property contains the TCP port for the firewall Host .
- firewallUserThis property contains a user name if authentication is to be used connecting through a firewall.
- firstArticleThe number of the first article in CurrentGroup .
- groupListCountThe number of records in the GroupList arrays.
- groupListCanPost:(int)groupListIndexThis property indicates whether a group in a newsgroup listing allows postings or articles.
- groupListFirstArticle:(int)groupListIndexThis property shows the first available article in a newsgroup listing.
- groupListGroup:(int)groupListIndexThis property shows the group name in a newsgroup listing.
- groupListLastArticle:(int)groupListIndexThis property shows the last available article in a newsgroup listing.
- idleThe current status of the class.
- lastArticleThe number of the last article in CurrentGroup .
- lastReplyThe last reply from the server.
- localFileThe path to a local file for downloading the article body. If the file exists, it is overwritten (optional).
- localHostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
- maxLinesThe maximum number of message lines aside from headers to retrieve.
- newsgroupsA comma separated list of newsgroups in which to post the article.
- newsPortThe server port for secure NNTP (default 119).
- newsServerThe name or address of a news server.
- organizationThe organization of the author (for posting articles).
- otherHeadersAn RFC850 compliant string consisting of extra headers (for posting articles).
- overviewRangeA range for the GroupOverview method (first-last).
- parsedHeaderCountThe number of records in the ParsedHeader arrays.
- parsedHeaderField:(int)parsedHeaderIndexThis property contains the name of the HTTP header (same case as it is delivered).
- parsedHeaderValue:(int)parsedHeaderIndexThis property contains the header contents.
- passwordA logon password for the NewsServer .
- searchHeaderA header for the GroupSearch method.
- searchPatternA search pattern for the GroupSearch method.
- searchRangeA range for the GroupSearch method (first-last).
- SSLAcceptServerCertEncodedThe certificate (PEM/base64 encoded).
- SSLCertEncodedThe certificate (PEM/base64 encoded).
- SSLCertStoreThe name of the certificate store for the client certificate.
- SSLCertStorePasswordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
- SSLCertStoreTypeThe type of certificate store for this certificate.
- SSLCertSubjectThe subject of the certificate used for client authentication.
- SSLEnabledWhether TLS/SSL is enabled.
- SSLServerCertEncodedThe certificate (PEM/base64 encoded).
- SSLStartModeDetermines how the class starts the SSL negotiation.
- timeoutA timeout for the class.
- userA 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.

- configSets or retrieves a configuration setting.
- connectConnects to the news server.
- disconnectDisconnects from the news server.
- doEventsProcesses events from the internal message queue.
- fetchArticleGet the headers and body of an article specified in CurrentArticle .
- fetchArticleBodyGets only the body of an article specified in CurrentArticle .
- fetchArticleHeadersGets only the headers of an article specified in CurrentArticle .
- groupOverviewReceives an overview for the articles in range OverviewRange in the CurrentGroup .
- groupSearchReceives an overview for the articles in range SearchRange in the CurrentGroup .
- interruptInterrupt the current method.
- listGroupsLists all groups on the server.
- listNewGroupsLists all new groups on the server.
- localizeDateConverts a valid RFC 822 message date to local date and time.
- postArticlePosts the current article and attached file.
- resetReset the class.
- resetHeadersResets 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.

- onConnectionStatusFired to indicate changes in connection state.
- onEndTransferFired when the article text completes transferring.
- onErrorInformation about errors during data delivery.
- onGroupListFired while group data transfers (during group listings).
- onGroupOverviewFired for each line of article overview data (during group overviews).
- onGroupSearchFired for each line of group search data (during group searches).
- onHeaderFired for every article header being retrieved during article retrieval.
- onPITrailTraces the commands sent to the news server, and the respective replies.
- onSSLServerAuthenticationFired after the server presents its certificate to the client.
- onSSLStatusShows the progress of the secure connection.
- onStartTransferFired when the article text starts transferring.
- onTransferFired 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.

ArticleInfoLimitInstructs class to save the amount of articles specified that are returned by the server when a GroupOverview event is fired.
GroupInfoLimitInstructs class to save the amount of group info objects specified that are returned by the server after a ListGroups call has been made.
MaxHeaderLengthMaximum length for headers to avoid line folding (default 80).
ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the class whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the class binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
ProxyExceptionsListA semicolon separated list of hosts and IPs to bypass when using a proxy.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
TcpNoDelayWhether or not to delay when sending packets.
UseIPv6Whether to use IPv6.
LogSSLPacketsControls whether SSL packets are logged when using the internal security API.
OpenSSLCADirThe path to a directory containing CA certificates.
OpenSSLCAFileName of the file containing the list of CA's trusted by your application.
OpenSSLCipherListA string that controls the ciphers to be used by SSL.
OpenSSLPrngSeedDataThe data to seed the pseudo random number generator (PRNG).
ReuseSSLSessionDetermines if the SSL session is reused.
SSLCACertFilePathsThe paths to CA certificate files on Unix/Linux.
SSLCACertsA newline separated list of CA certificate to use during SSL client authentication.
SSLCheckCRLWhether to check the Certificate Revocation List for the server certificate.
SSLCipherStrengthThe minimum cipher strength used for bulk encryption.
SSLEnabledCipherSuitesThe cipher suite to be used in an SSL negotiation.
SSLEnabledProtocolsUsed to enable/disable the supported security protocols.
SSLEnableRenegotiationWhether the renegotiation_info SSL extension is supported.
SSLIncludeCertChainWhether the entire certificate chain is included in the SSLServerAuthentication event.
SSLNegotiatedCipherReturns the negotiated ciphersuite.
SSLNegotiatedCipherStrengthReturns the negotiated ciphersuite strength.
SSLNegotiatedCipherSuiteReturns the negotiated ciphersuite.
SSLNegotiatedKeyExchangeReturns the negotiated key exchange algorithm.
SSLNegotiatedKeyExchangeStrengthReturns the negotiated key exchange algorithm strength.
SSLNegotiatedVersionReturns the negotiated protocol version.
SSLProviderThe name of the security provider to use.
SSLSecurityFlagsFlags that control certificate verification.
SSLServerCACertsA newline separated list of CA certificate to use during SSL server certificate validation.
TLS12SignatureAlgorithmsDefines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True.
TLS12SupportedGroupsThe supported groups for ECC.
TLS13KeyShareGroupsThe groups for which to pregenerate key shares.
TLS13SignatureAlgorithmsThe allowed certificate signature algorithms.
TLS13SupportedGroupsThe supported groups for (EC)DHE key exchange.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 iOS Edition - Version 20.0 [Build 8307]