Code example for InetAddress

Methods: getHostName

	protected InetSocketAddress getLocalAddress( InetAddress addr, int port )
	throws UnknownHostException 
		return new InetSocketAddress( addr.getHostName().equals( "" ) ? InetAddress.getLocalHost() : addr, port );
	 *	Establishes connection for transports requiring 
	 *	connectivity (e.g. TCP). For transports that do not require connectivity (e.g. UDP), 
	 *	this ensures the communication channel is created and bound. 
	 *  <P> 
	 *  Having a connected channel without actually listening to incoming messages 
	 *  is usually not making sense. You can call <code>startListening</code> without 
	 *  explicit prior call to <code>connect</code>, because <code>startListening</code> 
	 *  will establish the connection if necessary. 
	 *  <P> 
	 *	When a <B>UDP</B> transmitter 
	 *	is created without an explicit <code>DatagramChannel</code> &ndash; say by