net.i2p.client.streaming
Class I2PSocketAddress
java.lang.Object
java.net.SocketAddress
net.i2p.client.streaming.I2PSocketAddress
- All Implemented Interfaces:
- Serializable
public class I2PSocketAddress
- extends SocketAddress
A SocketAddress (Destination + port) so we can have SocketChannels.
Ports are not widely used in I2P, in most cases the port will be zero.
See InetSocketAddress for javadocs.
Warning, this interface and implementation is preliminary and subject to change without notice.
- Since:
- 0.9.1
- See Also:
- Serialized Form
I2PSocketAddress
public I2PSocketAddress(Destination dest,
int port)
- Does not do a reverse lookup. Host will be null.
I2PSocketAddress
public I2PSocketAddress(String host,
int port)
- Does a naming service lookup to resolve the dest.
May take several seconds for b32.
createUnresolved
public static I2PSocketAddress createUnresolved(String host,
int port)
getPort
public int getPort()
getAddress
public Destination getAddress()
getHostName
public String getHostName()
- Returns:
- the host only if given in the constructor. Does not do a reverse lookup.
isUnresolved
public boolean isUnresolved()
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object