SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkConnect(address.getHostName(), port);
SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkConnect(address.getHostAddress(), port);
  public void connect(InetAddress address, int port)  {    if (address == null)      throw new IllegalArgumentException("Connect address may not be null");		if ((port < 1) || (port > 65535))      throw new IllegalArgumentException("Port number is illegal: " + port);		SecurityManager sm = System.getSecurityManager();		if (sm != null)      sm.checkConnect(address.getHostName(), port);    try      {	getImpl().connect(address, port);	remoteAddress = address;	remotePort = port;      }    catch (SocketException e)      {	// This means simply not connected or connect not implemented.      }	}