ComponentSpace.WhoIs

ComponentSpace Who Is Class Library Reference

ComponentSpace.WhoIs Namespace

The ComponentSpace.WhoIs namespace contains classes that implement the Who Is protocol.

Namespace hierarchy

Classes

Class | Description
LookupCompletedEventArgs | Provides data for the LookupCompleted event.
WhoIsClient | Looks up domain registration and other information by sending query messages to who is servers.
WhoIsException | The exception that is thrown when a Who Is operation fails.

Delegates

Delegate | Description
LookupCompletedEventHandler | Represents the method that will handle the LookupCompleted event.


LookupCompletedEventArgs Class

Provides data for the LookupCompleted event.

For a list of all members of this type, see LookupCompletedEventArgs Members.

System.Object
System.EventArgs
ComponentSpace.WhoIs.LookupCompletedEventArgs

[Visual Basic]
Public Class LookupCompletedEventArgs
Inherits EventArgs
[C#]
public class LookupCompletedEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The LookupCompleted event is raised by the WhoIsClient. It contains all the information needed to complete the asynchronous who is operation.

Requirements

Namespace: ComponentSpace.WhoIs

Assembly: ComponentSpace.WhoIs (in ComponentSpace.WhoIs.dll)

See Also

LookupCompletedEventArgs Members | ComponentSpace.WhoIs Namespace


LookupCompletedEventArgs Members

LookupCompletedEventArgs overview

Public Instance Properties

AsyncResult Gets the result of the asynchronous who is operation.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

LookupCompletedEventArgs Class | ComponentSpace.WhoIs Namespace


LookupCompletedEventArgs Properties

The properties of the LookupCompletedEventArgs class are listed below. For a complete list of LookupCompletedEventArgs class members, see the LookupCompletedEventArgs Members topic.

Public Instance Properties

AsyncResult Gets the result of the asynchronous who is operation.

See Also

LookupCompletedEventArgs Class | ComponentSpace.WhoIs Namespace


LookupCompletedEventArgs.AsyncResult Property

Gets the result of the asynchronous who is operation.

[Visual Basic]
Public ReadOnly Property AsyncResult As IAsyncResult
[C#]
public System.IAsyncResult AsyncResult {get;}

Property Value

An IAsyncResult that contains the data associated with the who is operation.

Remarks

AsyncResult identifies ongoing or completed asynchronous operations. The property contains data that helps determine which of several potential asynchronous operations to complete, and when passed to the event handler, enables EndLookup to access the status associated with the completed operation.

See Also

LookupCompletedEventArgs Class | ComponentSpace.WhoIs Namespace


LookupCompletedEventHandler Delegate

Represents the method that will handle the LookupCompleted event.

[Visual Basic]
Public Delegate Sub LookupCompletedEventHandler( _
ByVal sender As Object, _
ByVal e As LookupCompletedEventArgs _
)
[C#]
public delegate void LookupCompletedEventHandler(
object sender,
LookupCompletedEventArgs e
);

Parameters

sender
The source of the event.
e
An LookupCompletedEventArgs that contains the event data.

Remarks

When you create a LookupCompletedEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

Requirements

Namespace: ComponentSpace.WhoIs

Assembly: ComponentSpace.WhoIs (in ComponentSpace.WhoIs.dll)

See Also

ComponentSpace.WhoIs Namespace


WhoIsClient Class

Looks up domain registration and other information by sending query messages to who is servers.

For a list of all members of this type, see WhoIsClient Members.

System.Object
ComponentSpace.WhoIs.WhoIsClient

[Visual Basic]
Public Class WhoIsClient
[C#]
public class WhoIsClient

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The WhoIsClient constructor specifies the address of the server. Optionally, the ReceiveTimeout may be set. The who is request may be sent and the reply received synchronously (blocking) using Lookup, or asynchronously (non-blocking) using BeginLookup, and EndLookup.

Requirements

Namespace: ComponentSpace.WhoIs

Assembly: ComponentSpace.WhoIs (in ComponentSpace.WhoIs.dll)

See Also

WhoIsClient Members | ComponentSpace.WhoIs Namespace


WhoIsClient Members

WhoIsClient overview

Public Instance Constructors

WhoIsClient Overloaded. Initializes a new instance of the WhoIsClient class.

Public Instance Properties

ReceiveTimeout | Gets or sets the number of milliseconds to wait for the response from the server.
SynchronizingObject | Gets or sets the synchonizing object for receiving events.

Public Instance Methods

BeginLookup | Overloaded. Initiates an asynchronous lookup operation.
EndLookup | Completes the specified asynchronous lookup operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Lookup | Look up domain registration and other information by sending the query message to the who is server and returning the server's response.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

LookupCompleted Occurs when the lookup has completed.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsClient Constructor

Initializes a new instance of the WhoIsClient class with the specified server address. The address can either be the name of the server (eg. whois.arin.net) or its IP address (eg. 63.146.182.182).

Overload List

Initializes a new instance of the WhoIsClient class with the specified server IP address.

public WhoIsClient(IPAddress);

Initializes a new instance of the WhoIsClient class with the specified server IP address.

public WhoIsClient(IPEndPoint);

Initializes a new instance of the WhoIsClient class with the specified server address. The address can either be the name of the server (eg. whois.arin.net) or its IP address (eg. 63.146.182.182).

public WhoIsClient(string);

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsClient Constructor (String)

Initializes a new instance of the WhoIsClient class with the specified server address. The address can either be the name of the server (eg. whois.arin.net) or its IP address (eg. 63.146.182.182).

[Visual Basic]
Overloads Public Sub New( _
ByVal serverAddress As String _
)
[C#]
public WhoIsClient(
string serverAddress
);

Parameters

serverAddress
The server address (eg. 63.146.182.182 or whois.arin.net).

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace | WhoIsClient Constructor Overload List


WhoIsClient Constructor (IPAddress)

Initializes a new instance of the WhoIsClient class with the specified server IP address.

[Visual Basic]
Overloads Public Sub New( _
ByVal serverAddress As IPAddress _
)
[C#]
public WhoIsClient(
IPAddress serverAddress
);

Parameters

serverAddress
The server IP address.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace | WhoIsClient Constructor Overload List


WhoIsClient Constructor (IPEndPoint)

Initializes a new instance of the WhoIsClient class with the specified server IP address.

[Visual Basic]
Overloads Public Sub New( _
ByVal serverAddress As IPEndPoint _
)
[C#]
public WhoIsClient(
IPEndPoint serverAddress
);

Parameters

serverAddress
The server IP address.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace | WhoIsClient Constructor Overload List


WhoIsClient Properties

The properties of the WhoIsClient class are listed below. For a complete list of WhoIsClient class members, see the WhoIsClient Members topic.

Public Instance Properties

ReceiveTimeout | Gets or sets the number of milliseconds to wait for the response from the server.
SynchronizingObject | Gets or sets the synchonizing object for receiving events.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsClient.ReceiveTimeout Property

Gets or sets the number of milliseconds to wait for the response from the server.

[Visual Basic]
Public Property ReceiveTimeout As Integer
[C#]
public int ReceiveTimeout {get; set;}

Property Value

The number of milliseconds to wait for the response from the server. The default is 10 seconds.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsClient.SynchronizingObject Property

Gets or sets the synchonizing object for receiving events.

[Visual Basic]
Public Property SynchronizingObject As ISynchronizeInvoke
[C#]
public System.ComponentModel.ISynchronizeInvoke SynchronizingObject {get; set;}

Property Value

An ISynchronizeInvoke, which represents the object that marshals the event-handler call resulting from a LookupCompleted event. The default is a null reference (Nothing in Visual Basic).

Remarks

A LookupCompleted event results from a BeginLookup request to a specific thread. Typically, the SynchronizingObject is set when it's used within a form, because forms are bound to a specific thread.

Typically, the synchronizing object marshals a method call into a single thread.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsClient Methods

The methods of the WhoIsClient class are listed below. For a complete list of WhoIsClient class members, see the WhoIsClient Members topic.

Public Instance Methods

BeginLookup | Overloaded. Initiates an asynchronous lookup operation.
EndLookup | Completes the specified asynchronous lookup operation.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) | Gets the Type of the current instance.
Lookup | Look up domain registration and other information by sending the query message to the who is server and returning the server's response.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


BeginLookup Method

ComponentSpace Who Is Class Library Reference

WhoIsClient.BeginLookup Method

Initiates an asynchronous lookup operation.

Overload List

Initiates an asynchronous lookup operation.

public IAsyncResult BeginLookup(string);

Initiates an asynchronous lookup operation that has a specified state object.

public IAsyncResult BeginLookup(string,object);

Initiates an asynchronous lookup operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.

public IAsyncResult BeginLookup(string,object,AsyncCallback);

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsClient.BeginLookup Method (String)

Initiates an asynchronous lookup operation.

[Visual Basic]
Overloads Public Function BeginLookup( _
ByVal query As String _
) As IAsyncResult
[C#]
public IAsyncResult BeginLookup(
string query
);

Parameters

query
The who is query message to send to the server.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Remarks

In asynchronous processing, you use BeginLookup to raise the LookupCompleted event when the lookup operation has completed.

To use BeginLookup, create an event handler that processes the results of the asynchronous operation and associate it with your event delegate. BeginLookup initiates an asynchronous lookup operation; the WhoIsClient is notified, through the raising of the LookupCompleted event, when the lookup operation is completed. The WhoIsClient can then access the lookup status by calling EndLookup.

Note: The BeginLookup method returns immediately, but the asynchronous operation is not completed until the event handler is called.

Because BeginLookup is asynchronous, you can call it to receive the lookup status without blocking the current thread of execution. To synchronously lookup, use the Lookup method.

Once an asynchronous operation completes, you can call BeginLookup again in the event handler to keep receiving notifications.

The IAsyncResult that BeginLookup returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndLookup is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace | WhoIsClient.BeginLookup Overload List


WhoIsClient.BeginLookup Method (String, Object)

Initiates an asynchronous lookup operation that has a specified state object.

[Visual Basic]
Overloads Public Function BeginLookup( _
ByVal query As String, _
ByVal stateObject As Object _
) As IAsyncResult
[C#]
public IAsyncResult BeginLookup(
string query,
object stateObject
);

Parameters

query
The who is query message to send to the server.
stateObject
A state object, specified by the application, that contains information associated with the asynchronous operation.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Remarks

In asynchronous processing, you use BeginLookup to raise the LookupCompleted event when the lookup operation has completed.

Use this overload to associate information with the operation that will be preserved throughout the operation's lifetime. The event handler can detect this information by looking at the AsyncState of the IAsyncResult that is associated with the operation.

To use BeginLookup, create an event handler that processes the results of the asynchronous operation and associate it with your event delegate. BeginLookup initiates an asynchronous lookup operation; the WhoIsClient is notified, through the raising of the LookupCompleted event, when the lookup operation is completed. The WhoIsClient can then access the lookup status by calling EndLookup.

Note: The BeginLookup method returns immediately, but the asynchronous operation is not completed until the event handler is called.

Because BeginLookup is asynchronous, you can call it to receive the lookup status without blocking the current thread of execution. To synchronously lookup, use the Lookup method.

Once an asynchronous operation completes, you can call BeginLookup again in the event handler to keep receiving notifications.

The IAsyncResult that BeginLookup returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndLookup is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.

The state object associates state information with the operation. For example, if you call BeginLookup multiple times to initiate multiple operations, you can identify each operation through a separate state object that you define.

You can also use the state object to pass information across process threads. If a thread is started but the callback is on a different thread in an asynchronous scenario, the state object is marshaled and passed back along with information from the event.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace | WhoIsClient.BeginLookup Overload List


WhoIsClient.BeginLookup Method (String, Object, AsyncCallback)

Initiates an asynchronous lookup operation that has a specified state object. This overload receives notification, through a callback, of the identity of the event handler for this operation.

[Visual Basic]
Overloads Public Function BeginLookup( _
ByVal query As String, _
ByVal stateObject As Object, _
ByVal asyncCallback As AsyncCallback _
) As IAsyncResult
[C#]
public IAsyncResult BeginLookup(
string query,
object stateObject,
AsyncCallback asyncCallback
);

Parameters

query
The who is query message to send to the server.
stateObject
A state object, specified by the application, that contains information associated with the asynchronous operation.
asyncCallback
The AsyncCallback that will receive the notification of the asynchronous operation completion.

Return Value

The IAsyncResult that identifies the posted asynchronous request.

Remarks

When you use this overload, the callback specified in the callback parameter is invoked directly when the lookup operation has completed; the LookupCompleted event is not raised. The other overloads of BeginLookup rely on this component to raise the LookupCompleted event.

To use BeginLookup, define an asynchronous callback method. BeginLookup initiates an asynchronous lookup operation; the WhoIsClient is notified, through a call to the callback method, when the lookup operation is completed. The WhoIsClient can then access the lookup status by calling EndLookup.

Use this overload to associate information with the operation that will be preserved throughout the operation's lifetime. The event handler can detect this information by looking at the AsyncState of the IAsyncResult that is associated with the operation.

Note: The BeginLookup method returns immediately, but the asynchronous operation is not completed until the event handler is called.

Because BeginLookup is asynchronous, you can call it to receive the lookup status without blocking the current thread of execution. To synchronously lookup, use the Lookup method.

Once an asynchronous operation completes, you can call BeginLookup again in the event handler to keep receiving notifications.

The IAsyncResult that BeginLookup returns identifies the asynchronous operation that the method call started. You can use this IAsyncResult throughout the lifetime of the operation, although you generally do not use it until EndLookup is called. However, if you start several asynchronous operations, you can place their IAsyncResult values in an array and specify whether to wait for all operations or any operation to complete. In this case, you use the AsyncWaitHandle property of the IAsyncResult to identify the completed operation.

The state object associates state information with the operation. For example, if you call BeginLookup multiple times to initiate multiple operations, you can identify each operation through a separate state object that you define.

You can also use the state object to pass information across process threads. If a thread is started but the callback is on a different thread in an asynchronous scenario, the state object is marshaled and passed back along with information from the event.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace | WhoIsClient.BeginLookup Overload List


WhoIsClient.EndLookup Method

Completes the specified asynchronous lookup operation.

[Visual Basic]
Public Function EndLookup( _
ByVal asyncResult As IAsyncResult _
) As String
[C#]
public string EndLookup(
IAsyncResult asyncResult
);

Parameters

asyncResult
The IAsyncResult that identifies the asynchronous lookup operation to finish, and from which to retrieve an end result.

Return Value

The who is response from the server.

Remarks

When the LookupCompleted event is raised, EndLookup completes the operation that was initiated by the BeginLookup call.

Exceptions

Exception Type | Condition
WhoIsException | Thrown when the message cannot be sent.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsClient.Lookup Method

Look up domain registration and other information by sending the query message to the who is server and returning the server's response.

[Visual Basic]
Public Function Lookup( _
ByVal query As String _
) As String
[C#]
public string Lookup(
string query
);

Parameters

query
The who is query message to send to the server.

Return Value

The who is response from the server.

Exceptions

Exception Type | Condition
WhoIsException | Thrown when the message cannot be sent or a response cannot be received.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsClient Events

The events of the WhoIsClient class are listed below. For a complete list of WhoIsClient class members, see the WhoIsClient Members topic.

Public Instance Events

LookupCompleted Occurs when the lookup has completed.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsClient.LookupCompleted Event

Occurs when the lookup has completed.

[Visual Basic]
Public Event LookupCompleted As LookupCompletedEventHandler
[C#]
public event LookupCompletedEventHandler LookupCompleted;

Event Data

The event handler receives an argument of type LookupCompletedEventArgs containing data related to this event. The following LookupCompletedEventArgs property provides information specific to this event.

Property | Description
AsyncResult | Gets the result of the asynchronous who is operation.

Remarks

BeginLookup is used in asynchronous processing to raise the LookupCompleted event when the lookup operation has completed.

EndLookup is used to complete the operation initiated by a call to BeginLookup and get looked up information when the LookupCompleted event is raised.

See Also

WhoIsClient Class | ComponentSpace.WhoIs Namespace


WhoIsException Class

The exception that is thrown when a Who Is operation fails.

For a list of all members of this type, see WhoIsException Members.

System.Object
System.Exception
System.ApplicationException
ComponentSpace.WhoIs.WhoIsException

[Visual Basic]
Public Class WhoIsException
Inherits ApplicationException
[C#]
public class WhoIsException : ApplicationException

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: ComponentSpace.WhoIs

Assembly: ComponentSpace.WhoIs (in ComponentSpace.WhoIs.dll)

See Also

WhoIsException Members | ComponentSpace.WhoIs Namespace


WhoIsException Members

WhoIsException overview

Public Instance Properties

HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message (inherited from Exception) | Gets a message that describes the current exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

WhoIsException Class | ComponentSpace.WhoIs Namespace


ComponentSpace.WhoIsHierarchy

ComponentSpace Who Is Class Library Reference

ComponentSpace.WhoIs Hierarchy

System.Object
ComponentSpace.WhoIs.WhoIsClient
System.Delegate ---- System.ICloneable, System.Runtime.Serialization.ISerializable
System.MulticastDelegate
ComponentSpace.WhoIs.LookupCompletedEventHandler
System.EventArgs
ComponentSpace.WhoIs.LookupCompletedEventArgs
System.Exception ---- System.Runtime.Serialization.ISerializable
System.ApplicationException
ComponentSpace.WhoIs.WhoIsException

See Also

ComponentSpace.WhoIs Namespace