Code example for InetSocketAddress

Methods: getHostName, getPort

0
		this.host = host;
		this.port = port;
	} 
 
	public Endpoint(InetSocketAddress addr) {
		host = addr.getHostName();
		port = addr.getPort();
	} 
 
	@Override 
	public boolean equals(Object t) {
		return (t instanceof Endpoint) && (port == ((Endpoint) t).port) && host.equals(((Endpoint) t).host);
	} 
 
	@Override 
	public int hashCode() { 
		return host.hashCode() + port;
	} 
 
	@Override 
	public String toString() {