Code example for InetAddress

Methods: toString

0
	 *function:Èç¹ûÓС®/¡¯×Ö·û´®£¬Ôò½«ÆäÈ¥µô 
	 *  
	 * @return 
	 */ 
	public String getStringIP() {
		String ipAddress = ip.toString();
		if (ipAddress.indexOf('/') == 0)
			ipAddress = ipAddress.substring(1);
		return ipAddress;
	} 
 
	public Integer getPort() {
		return port;
	} 
 
	public void setPort(Integer port) {
		this.port = port;
	} 
 
	public String toString() {
		return this.getStringIP() + ":" + this.getPort();