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