fr.dyade.aaa.util

Class SocketAddress


public class SocketAddress
extends java.lang.Object

This class implements an IP Socket Address (IP address + port number)

Constructor Summary

SocketAddress(String hostname, int port)
Creates a socket address from a hostname and a port number.

Method Summary

boolean
equals(Object obj)
Compares this object against the specified object.
InetAddress
getAddress()
Gets the InetAddress.
String
getHostname()
Gets the hostname.
int
getPort()
Gets the port number.
InetAddress
resetAddr()
Resolves the IP address for this hostname, don't use an eventually caching address.
String
toString()
Constructs a string representation of this InetSocketAddress.

Constructor Details

SocketAddress

public SocketAddress(String hostname,
                     int port)
Creates a socket address from a hostname and a port number.

Parameters:
hostname - the Host name
port - The port number

Method Details

equals

public boolean equals(Object obj)
Compares this object against the specified object.

Parameters:
obj - the object to compare against.

Returns:
true if the objects are the same; false otherwise.


getAddress

public InetAddress getAddress()
Gets the InetAddress.

Returns:
the InetAdress or null if it is unresolved.


getHostname

public String getHostname()
Gets the hostname.

Returns:
the hostname part of the address.


getPort

public int getPort()
Gets the port number.

Returns:
the port number.


resetAddr

public InetAddress resetAddr()
Resolves the IP address for this hostname, don't use an eventually caching address.

Returns:
the resolved IP address.


toString

public String toString()
Constructs a string representation of this InetSocketAddress.

Returns:
a string representation of this object.


Copyright B) 2004 Scalagent - All rights reserved