public void close() { if (host != null) host.close(); }
public SocketInterface newSocket() throws IOException { if (host != null) return host.newSocket(); else return new RealSocket(); }
public ServerSocketInterface newServerSocket(int port) throws IOException { if (host != null) return host.newServerSocket(port); else return new RealServerSocket(port); }
public String getHostName() throws UnknownHostException { if (host != null) return host.getHostName(); else return InetAddress.getLocalHost().getHostName(); }