Class TrackbackClient
Allows applications to send and received notification pings by using the Trackback peer-to-peer notification protocol.
Inheritance
Inherited Members
Namespace: Argotic.Net
Assembly: Argotic.Core.dll
Syntax
public class TrackbackClient
Remarks
This implementation of Trackback is based on the Trackback 1.2 specification which can be found at http://www.sixapart.com/pronet/docs/trackback_spec.
Examples
Constructors
| Improve this Doc View SourceTrackbackClient()
Initializes a new instance of the TrackbackClient class.
Declaration
public TrackbackClient()
TrackbackClient(Uri)
Initializes a new instance of the TrackbackClient class that sends Trackback pings using the specified Trackback server.
Declaration
public TrackbackClient(Uri host)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | host | A System.Uri that represents the URL of the host computer used for Trackback transactions. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
TrackbackClient(Uri, String)
Initializes a new instance of the TrackbackClient class that sends Trackback pings using the specified Trackback server and user agent.
Declaration
public TrackbackClient(Uri host, string userAgent)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | host | A System.Uri that represents the URL of the host computer used for Trackback transactions. |
System.String | userAgent | Information such as the application name, version, host operating system, and language. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |
System.ArgumentNullException | The |
Properties
| Improve this Doc View SourceCredentials
Gets or sets the authentication credentials utilized by this client when making Trackback pings.
Declaration
public ICredentials Credentials { get; set; }
Property Value
Type | Description |
---|---|
System.Net.ICredentials | A System.Net.ICredentials object that represents the authentication credentials provided by this client when making Trackback pings. The default is a null reference (Nothing in Visual Basic), which indicates no authentication information will be supplied to identify the maker of the request. |
Host
Gets or sets the location of the host computer that client Trackback pings will be sent to.
Declaration
public Uri Host { get; set; }
Property Value
Type | Description |
---|---|
System.Uri | A System.Uri that represents the URL of the host computer used for Trackback transactions. |
Remarks
If Host is a null reference (Nothing in Visual Basic), Host is initialized using the settings in the application or machine configuration files.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
Proxy
Gets or sets the web proxy utilized by this client to proxy Trackback pings.
Declaration
public IWebProxy Proxy { get; set; }
Property Value
Type | Description |
---|---|
System.Net.IWebProxy | A System.Net.IWebProxy object that represents the web proxy utilized by this client to proxy Trackback pings. The default is a null reference (Nothing in Visual Basic), which indicates no proxy will be used to proxy the request. |
Timeout
Gets or sets a value that specifies the amount of time after which asynchronous send operations will time out.
Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type | Description |
---|---|
System.TimeSpan | A System.TimeSpan that specifies the time-out period. The default value is 15 seconds. |
Remarks
If Timeout is equal to System.TimeSpan.MinValue, Timeout is initialized using the settings in the application or machine configuration files.
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | The time out period is less than zero. |
System.ArgumentOutOfRangeException | The time out period is greater than a year. |
UseDefaultCredentials
Gets or sets a System.Boolean value that controls whether the System.Net.CredentialCache.DefaultCredentials are sent when making Trackback pings.
Declaration
public bool UseDefaultCredentials { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the default credentials are used; otherwise false. The default value is false. |
Remarks
Some Trackback servers require that the client be authenticated before the server executes Trackback pings on its behalf. Set this property to true when this TrackbackClient object should, if requested by the server, authenticate using the default credentials of the currently logged on user. For client applications, this is the desired behavior in most scenarios.
Credentials information can also be specified using the application and machine configuration files. For more information, see XmlRpcClientNetworkElement Element (Network Settings).
If the UseDefaultCredentials property is set to false, then the value set in the Credentials property will be used for the credentials when connecting to the server. If the UseDefaultCredentials property is set to false and the Credentials property has not been set, then Trackback pings are sent to the server anonymously.
UserAgent
Gets or sets information such as the client application name, version, host operating system, and language.
Declaration
public string UserAgent { get; set; }
Property Value
Type | Description |
---|---|
System.String | Information such as the client application name, version, host operating system, and language. The default value is an agent that describes this syndication framework. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |
Methods
| Improve this Doc View SourceOnMessageSent(TrackbackMessageSentEventArgs)
Raises the SendCompleted event.
Declaration
protected virtual void OnMessageSent(TrackbackMessageSentEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TrackbackMessageSentEventArgs | e | A TrackbackMessageSentEventArgs that contains the event data. |
Remarks
Classes that inherit from the TrackbackClient class can override the OnMessageSent(TrackbackMessageSentEventArgs) method to perform additional tasks when the SendCompleted event occurs.
OnMessageSent(TrackbackMessageSentEventArgs) also allows derived classes to handle SendCompleted without attaching a delegate. This is the preferred technique for handling SendCompleted in a derived class.
Send(TrackbackMessage)
Sends the specified message to a Trackback server to execute an Trackback ping request.
Declaration
public TrackbackResponse Send(TrackbackMessage message)
Parameters
Type | Name | Description |
---|---|---|
TrackbackMessage | message | A TrackbackMessage that represents the information needed to execute the Trackback ping request. |
Returns
Type | Description |
---|---|
TrackbackResponse | A TrackbackResponse that represents the server's response to the Trackback ping request. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.InvalidOperationException | The Host is a null reference (Nothing in Visual Basic). |
System.InvalidOperationException | This TrackbackClient has a SendAsync(TrackbackMessage, Object) call in progress. |
SendAsync(TrackbackMessage, Object)
Sends the specified message to an Trackback server to execute an Trackback ping request. This method does not block the calling thread and allows the caller to pass an object to the method that is invoked when the operation completes.
Declaration
public void SendAsync(TrackbackMessage message, object userToken)
Parameters
Type | Name | Description |
---|---|---|
TrackbackMessage | message | A TrackbackMessage that represents the information needed to execute the Trackback ping request. |
System.Object | userToken | A user-defined object that is passed to the method invoked when the asynchronous operation completes. |
Remarks
To receive notification when the Trackback ping request has been sent or the operation has been cancelled, add an event handler to the SendCompleted event. You can cancel a SendAsync(TrackbackMessage, Object) operation by calling the SendAsyncCancel() method.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.InvalidOperationException | The Host is a null reference (Nothing in Visual Basic). |
System.InvalidOperationException | This TrackbackClient has a SendAsync(TrackbackMessage, Object) call in progress. |
SendAsyncCancel()
Cancels an asynchronous operation to send an Trackback ping request.
Declaration
public void SendAsyncCancel()
Remarks
Use the SendAsyncCancel() method to cancel a pending SendAsync(TrackbackMessage, Object) operation. If there is an Trackback ping request waiting to be sent, this method releases resources used to execute the send operation and cancels the pending operation. If there is no send operation pending, this method does nothing.
Events
| Improve this Doc View SourceSendCompleted
Occurs when an asynchronous Trackback ping request send operation completes.
Declaration
public event EventHandler<TrackbackMessageSentEventArgs> SendCompleted
Event Type
Type | Description |
---|---|
System.EventHandler<TrackbackMessageSentEventArgs> |