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