Allows applications to send pingback pings by using the Pingback peer-to-peer communication protocol.
Namespace:
Argotic.Core.NetAssembly: Argotic.Core (in Argotic.Core)
Version: 2007.3.0.0 (2007.3.0.0)
Syntax
| C# |
|---|
public class PingbackClient : IDisposable |
| Visual Basic (Declaration) |
|---|
Public Class PingbackClient _ Implements IDisposable |
| Visual C++ |
|---|
public ref class PingbackClient : IDisposable |
Remarks
See http://www.hixie.ch/specs/pingback/pingback for more information about the Pingback peer-to-peer communication specification.
Examples
The following code example demonstrates the usage of PingbackClient.
CopyC#
using System; using System.Text; using Argotic.Core.Net; namespace Argotic.Test { public class PingbackClientCS { public PingbackClientCS() { //------------------------------------------------------------ // Initialize the pingback client //------------------------------------------------------------ PingbackClient client = new PingbackClient(); client.Timeout = TimeSpan.FromSeconds(10); //------------------------------------------------------------ // Define the pingback ping message to send //------------------------------------------------------------ PingbackMessage message = new PingbackMessage(); message.Source = new Uri("http://alice.example.org/#p123"); message.Target = new Uri("http://bob.example.net/#foo"); message.Encoding = Encoding.UTF8; message.UserAgent = XmlRpcMessage.FrameworkUserAgent; //------------------------------------------------------------ // Send the pingback ping //------------------------------------------------------------ XmlRpcResponse pingResponse; Uri pingbackServiceHost = new Uri("http://bob.example.net/xmlrpcserver"); pingResponse = client.Send(pingbackServiceHost, message); //------------------------------------------------------------ // Determine if pingback ping was sucessful //------------------------------------------------------------ if(pingResponse.HasFault) { //------------------------------------------------------------ // Get reason provided for pingback ping failure //------------------------------------------------------------ int failureFaultCode = pingResponse.FaultCode; string reasonForPingFailure = pingResponse.FaultReason; } } } }
