Code example for Socket

Methods: getPort

0
	 * @return Port 
	 * @throws IOException 
	 */ 
	public int getRemotePort() throws IOException { 
		if (socket != null) {
			return socket.getPort();
		} else { 
			throw new IOException("Connection not openned");
		} 
	} 
 
	/** 
	 * Returns the local address of the connection 
	 *  
	 * @return Address 
	 * @throws IOException 
	 */ 
	public String getLocalAddress() throws IOException {
		if (socket != null) {
			return socket.getLocalAddress().getHostAddress();
		} else {