|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ipworks.Ipinfo
The IPInfo class is used to resolve host names to host addresses and vice-versa using asynchronous DNS. The class provides access to other Winsock database functions as well.
The IPInfo class operates asynchronously. Requests are posted to the class by setting a property like HostName , HostAddress , ServiceName , ServicePort and then waiting for the RequestComplete event. The RequestId property identifies the request.
Up to 100 simultaneous requests can be queued at any moment. PendingRequests shows the number of pending requests, and may also be used to adjust the size of the queue (by dumping a number of the pending requests).
Constructor Summary | |
Ipinfo()
|
Method Summary | |
void |
addIpinfoEventListener(IpinfoEventListener l)
|
void |
fireError(int errorCode,
java.lang.String description)
Information about errors during data delivery. |
void |
fireRequestComplete(int requestId,
int statusCode,
java.lang.String description)
Fired after an asynchronous request completes. |
java.lang.String |
getHostAddress()
An Internet Address in dotted format. |
java.lang.String |
getHostAliases()
Other names corresponding to the host with name HostName. |
java.lang.String |
getHostName()
The Domain Name of an Internet host. |
java.lang.String |
getLocalHost()
The name of the local host. |
java.lang.String |
getOtherAddresses()
Other addresses for the host identified by HostName (for multihomed hosts). |
int |
getPendingRequests()
The number of requests awaiting for completion. |
int |
getRequestId()
The handle of the last request. |
java.lang.String |
getServiceAliases()
Other names by which the service specified by ServiceName / ServicePort is known. |
java.lang.String |
getServiceName()
A name for a service. |
int |
getServicePort()
A port number for a service. |
java.lang.String |
getServiceProtocol()
The protocol of the service specified by ServiceName / ServicePort . |
void |
removeIpinfoEventListener(IpinfoEventListener l)
|
void |
setHostAddress(java.lang.String hostAddress)
An Internet Address in dotted format. |
void |
setHostName(java.lang.String hostName)
The Domain Name of an Internet host. |
void |
setPendingRequests(int pendingRequests)
The number of requests awaiting for completion. |
void |
setServiceName(java.lang.String serviceName)
A name for a service. |
void |
setServicePort(int servicePort)
A port number for a service. |
void |
setServiceProtocol(java.lang.String serviceProtocol)
The protocol of the service specified by ServiceName / ServicePort . |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Ipinfo()
Method Detail |
public java.lang.String getHostAddress()
If HostAddress is set to an IP address, a search is initiated for the corresponding host names(s). The RequestComplete event is fired when the search is complete. The RequestId property identifies the pending request.
public void setHostAddress(java.lang.String hostAddress) throws IPWorksException
If HostAddress is set to an IP address, a search is initiated for the corresponding host names(s). The RequestComplete event is fired when the search is complete. The RequestId property identifies the pending request.
public java.lang.String getHostAliases()
public java.lang.String getHostName()
If HostName is set to a domain name, a search is initiated for the corresponding host address(s). The RequestComplete event is fired when the search is complete. The RequestId property identifies the pending request.
public void setHostName(java.lang.String hostName) throws IPWorksException
If HostName is set to a domain name, a search is initiated for the corresponding host address(s). The RequestComplete event is fired when the search is complete. The RequestId property identifies the pending request.
public java.lang.String getLocalHost()
If the class is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).
public java.lang.String getOtherAddresses()
public int getPendingRequests()
To cancel all the pending requests at any moment, simply set PendingRequests to 0.
public void setPendingRequests(int pendingRequests) throws IPWorksException
To cancel all the pending requests at any moment, simply set PendingRequests to 0.
public int getRequestId()
public java.lang.String getServiceAliases()
public java.lang.String getServiceName()
If ServiceName is set to a service name, a search is initiated for the corresponding ServicePort and other information related to the service (if any). The RequestComplete event is fired when the search is complete. RequestId identifies the pending request.
public void setServiceName(java.lang.String serviceName) throws IPWorksException
If ServiceName is set to a service name, a search is initiated for the corresponding ServicePort and other information related to the service (if any). The RequestComplete event is fired when the search is complete. RequestId identifies the pending request.
public int getServicePort()
If ServicePort is set to a port number, a search is initiated for the ServiceName and other information related to the service (if any). The RequestComplete event is fired when the search is complete. RequestId identifies the pending request.
public void setServicePort(int servicePort) throws IPWorksException
If ServicePort is set to a port number, a search is initiated for the ServiceName and other information related to the service (if any). The RequestComplete event is fired when the search is complete. RequestId identifies the pending request.
public java.lang.String getServiceProtocol()
Setting ServiceProtocol to a particular protocol name (for example 'udp' or 'tcp') will force a search for a service for that protocol only. If ServiceProtocol is set to "" (empty string) then the first entry for the service will be returned and ServiceProtocol will be set to the corresponding protocol.
public void setServiceProtocol(java.lang.String serviceProtocol) throws IPWorksException
Setting ServiceProtocol to a particular protocol name (for example 'udp' or 'tcp') will force a search for a service for that protocol only. If ServiceProtocol is set to "" (empty string) then the first entry for the service will be returned and ServiceProtocol will be set to the corresponding protocol.
public void fireError(int errorCode, java.lang.String description)
IpinfoErrorEvent
public void fireRequestComplete(int requestId, int statusCode, java.lang.String description)
IpinfoRequestCompleteEvent
public void addIpinfoEventListener(IpinfoEventListener l) throws java.util.TooManyListenersException
public void removeIpinfoEventListener(IpinfoEventListener l)
|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |