C# Class NntpClient.Client

Connects & performs operations on a usenet server.
Inheritance: IDisposable
Mostrar archivo Open project: strider-/NntpClient

Public Methods

Method Description
ArticleExists ( string messageId ) : bool

Gets whether or not the article is available to download.

ArticleExists ( ulong articleId ) : bool

Gets whether or not the article is available to download.

Authenticate ( string user, string pass ) : void

Authenticates credentials against the current server.

Client ( ) : System

Creates a new intance of the client.

Close ( ) : ConnectionResult

Closes the connection & returns the statistics of the session.

Connect ( string hostname, int port, bool ssl ) : void

Opens a connection to the given usenet server on the specified port, and whether or not to use ssl.

Date ( ) : System.DateTime

Gets the current UTC date/time on the server.

Dispose ( ) : void

Closes the connection & disposes of managed resources.

GetArticle ( string messageId, bool bodyOnly = false ) : Article

Downloads an article from usenet with the given ID. Returns null if the article could not be found.

GetArticle ( ulong articleId, bool bodyOnly = false ) : Article

Downloads an article from usenet with the given ID. Returns null if the article could not be found.

GetGroups ( ) : IEnumerable

Returns a collection of available usenet groups.

GetHeaders ( string messageId ) : string>.Dictionary

Fetches only the headers of a message with the given message ID.

GetHeaders ( ulong articleId ) : string>.Dictionary

Fetches only the headers of a message with the given article ID.

GetOverviewFormat ( ) : IEnumerable

Fetches all overview fields supported by the server as a list.

GetXOverview ( ulong articleStart, ulong articleEnd ) : IEnumerable

Fetches overview database information from a group within a given range of article ids. A call to SetGroup must be made before calling this method or it will fail.

SetGroup ( string groupName ) : Group

Sets the current usenet group pointer.

SetGroup ( Group group ) : bool

Sets the current usenet group pointer.

Private Methods

Method Description
CleanUp ( ) : void
ProcessArticle ( ServerReply result, bool bodyOnly ) : Article
ReadHeader ( ) : string>.Dictionary
SetMode ( string mode ) : void

Method Details

ArticleExists() public method

Gets whether or not the article is available to download.
public ArticleExists ( string messageId ) : bool
messageId string Message-ID of the article
return bool

ArticleExists() public method

Gets whether or not the article is available to download.
public ArticleExists ( ulong articleId ) : bool
articleId ulong
return bool

Authenticate() public method

Authenticates credentials against the current server.
public Authenticate ( string user, string pass ) : void
user string Usenet username
pass string Usenet password
return void

Client() public method

Creates a new intance of the client.
public Client ( ) : System
return System

Close() public method

Closes the connection & returns the statistics of the session.
public Close ( ) : ConnectionResult
return ConnectionResult

Connect() public method

Opens a connection to the given usenet server on the specified port, and whether or not to use ssl.
public Connect ( string hostname, int port, bool ssl ) : void
hostname string Usenet hostname
port int Port to connect on
ssl bool Uses a secure connection if true
return void

Date() public method

Gets the current UTC date/time on the server.
public Date ( ) : System.DateTime
return System.DateTime

Dispose() public method

Closes the connection & disposes of managed resources.
public Dispose ( ) : void
return void

GetArticle() public method

Downloads an article from usenet with the given ID. Returns null if the article could not be found.
public GetArticle ( string messageId, bool bodyOnly = false ) : Article
messageId string
bodyOnly bool Whether or not to pull down headers with the article or not.
return Article

GetArticle() public method

Downloads an article from usenet with the given ID. Returns null if the article could not be found.
public GetArticle ( ulong articleId, bool bodyOnly = false ) : Article
articleId ulong
bodyOnly bool Whether or not to pull down headers with the article or not.
return Article

GetGroups() public method

Returns a collection of available usenet groups.
public GetGroups ( ) : IEnumerable
return IEnumerable

GetHeaders() public method

Fetches only the headers of a message with the given message ID.
public GetHeaders ( string messageId ) : string>.Dictionary
messageId string Message Id
return string>.Dictionary

GetHeaders() public method

Fetches only the headers of a message with the given article ID.
public GetHeaders ( ulong articleId ) : string>.Dictionary
articleId ulong Article Id
return string>.Dictionary

GetOverviewFormat() public method

Fetches all overview fields supported by the server as a list.
public GetOverviewFormat ( ) : IEnumerable
return IEnumerable

GetXOverview() public method

Fetches overview database information from a group within a given range of article ids. A call to SetGroup must be made before calling this method or it will fail.
public GetXOverview ( ulong articleStart, ulong articleEnd ) : IEnumerable
articleStart ulong The start of the article range to pull overview information for.
articleEnd ulong The end of the article range to pull overview information for.
return IEnumerable

SetGroup() public method

Sets the current usenet group pointer.
public SetGroup ( string groupName ) : Group
groupName string
return Group

SetGroup() public method

Sets the current usenet group pointer.
public SetGroup ( Group group ) : bool
group Group
return bool