Resolves proxy address in other thread, to avoid annoying blocking in GUI
thread.
547700
public void run() {

		if (!initProxy()) {
			// Check if we have been aborted
			if (mode != OK_MODE)
				return;
			if (net_thread != Thread.currentThread())
				return;

			mode = COMMAND_MODE;
			warning_label.setText("Look up failed.");
			warning_label.invalidate();
			return;
		}

		// System.out.println("Done!");
		while (!warning_dialog.isShowing())
			; /* do nothing */
		;

		warning_dialog.dispose();
		// dispose(); //End Dialog
	}
893524
protected void intialiseNonPersistent(MultiMEProxyHandler proxyHandler,
                                        Neighbours neighbours)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "intialiseNonPersistent");

    iProxyHandler = proxyHandler;
    iNeighbours = neighbours;
    iDestinationManager =
      iProxyHandler.getMessageProcessor().getDestinationManager();
    iRemoteQueue = SIMPUtils.createJsSystemDestinationAddress(
          SIMPConstants.PROXY_SYSTEM_DESTINATION_PREFIX, iMEUuid, iBusId);
    if (iMEUuid == null)
      iMEUuid = iRemoteQueue.getME();

    iProxies = new Hashtable();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "intialiseNonPersistent");
  }
523596
def ping(self, remote):
        """"""
        try:
            self.proxies["%s-%s" % (self._interface_id, remote)].ping("%s-%s" % (self._interface_id, remote))
        except Exception as err:
            LOG.warning("ServerThread.ping: Exception: %s" % str(err))
969347
def enable_proxy(self, host, port):
        """"""

        self.proxy = [host, _number(port)]
        self.proxy_enabled = True
482521
def accept(self, addr):
        

        # Add the address to the set
        ip_addr = _parse_ip(addr)
        if ip_addr is None:
            LOG.warn("Cannot add address %r to proxy %s: "
                     "invalid address" % (addr, self.address))
        else:
            self.accepted.add(addr)
492949
def _subthread_handle_accepted(self, client):
        

        conn, addr = client
        if self.handle_incoming(conn, addr):
            logging.info('Accepted connection from client: {}'.format(addr))
            conn.setblocking(False)
            self.clients[conn] = addr
            self.register(conn)
        else:
            logging.info('Refused connection from client: {}'.format(addr))
            self.disconnect(conn)
748253
public static void applyProxy(Proxy use) {
    System.setProperty("java.net.useSystemProxies", "false");
    System.setProperty("http.proxyHost", use.getIp());
    System.setProperty("http.proxyPort", String.valueOf(use.getPort()));
    System.setProperty("https.proxyHost", use.getIp());
    System.setProperty("https.proxyPort", String.valueOf(use.getPort()));
  }
326726
def stop(self):
        """"""
        stopped = []
        for interface_id, proxy in self.proxies.items():
            if interface_id in self.failed_inits:
                LOG.warning("ServerThread.stop: Not performing de-init for %s" % interface_id)
                continue
            if proxy._callbackip and proxy._callbackport:
                callbackip = proxy._callbackip
                callbackport = proxy._callbackport
            else:
                callbackip = proxy._localip
                callbackport = self._localport
            remote = "http://%s:%i" % (callbackip, callbackport)
            LOG.debug("ServerThread.stop: init('%s')" % remote)
            if not callbackip in stopped:
                try:
                    proxy.init(remote)
                    stopped.append(callbackip)
                    LOG.info("Proxy de-initialized: %s" % remote)
                except Exception as err:
                    LOG.debug("proxyInit: Exception: %s" % str(err))
                    LOG.warning("Failed to de-initialize proxy")
        self.proxies.clear()
        LOG.info("Shutting down server")
        self.server.shutdown()
        LOG.debug("ServerThread.stop: Stopping ServerThread")
        self.server.server_close()
        LOG.info("Server stopped")
652849
@Override
    public void accept(ClassWriterOutputVisitor visitor) throws IOException {
        proxyBeanDefinitionWriter.accept(visitor);
        try (OutputStream out = visitor.visitClass(proxyFullName)) {
            out.write(classWriter.toByteArray());
            for (ExecutableMethodWriter method : proxiedMethods) {
                method.accept(visitor);
            }
        }
    }
410872
def remove_proxy(self, proxy):
        """"""
        del self.search_flag[proxy.protocol][proxy.addr]
        del self.addr_list[proxy.protocol][proxy.addr]
1122194
def resolve_real_bind_addr(socket_):
        """"""
        # FIXME: keep requested bind_addr separate real bound_addr (port
        # is different in case of ephemeral port 0)
        bind_addr = socket_.getsockname()
        if socket_.family in (
            # Windows doesn't have socket.AF_UNIX, so not using it in check
            socket.AF_INET,
            socket.AF_INET6,
        ):
            """UNIX domain sockets are strings or bytes.

            In case of bytes with a leading null-byte it's an abstract socket.
            """
            return bind_addr[:2]
        return bind_addr
788430
private void cleanup_heartbeat_proxies() {
        // disconnect the pushsupplier to stop receiving events
        Enumeration keys = event_callback_map.keys();
        while (keys.hasMoreElements()) {
            String name = (String) keys.nextElement();
            EventCallBackStruct callback_struct = event_callback_map.get(name);
            try {
                EventChannelStruct ec_struct = channel_map.get(callback_struct.channel_name);
                if (ec_struct.structuredProxyPushSupplier != null) {
                    //System.out.println("Disconnect " + callback_struct.channel_name);
                    ec_struct.structuredProxyPushSupplier.disconnect_structured_push_supplier();
                    ec_struct.structuredProxyPushSupplier = null;
                }
            } catch (Exception e) {
                System.out.println(e);
            }
            event_callback_map.remove(name);
        }
    }
815875
def ignore_proxy_host (self):
        """"""
        if urllib.proxy_bypass(self.host):
            return True
        no_proxy = os.environ.get("no_proxy")
        if no_proxy:
            entries = [parse_host_port(x) for x in no_proxy.split(",")]
            for host, port in entries:
                if host.lower() == self.host and port == self.port:
                    return True
        return False
1306486
public static void proxy(Method method, InvocationHandler invocationHandler) {
		assertInvocationHandlerNotNull(invocationHandler);
		MockRepository.putMethodProxy(method, invocationHandler);
	}
260861
public InetAddress address(boolean resolve) {
    if (resolve) {
      address = resolveAddress();
      return address;
    }

    if (address == null) {
      synchronized (this) {
        if (address == null) {
          address = resolveAddress();
        }
      }
    }
    return address;
  }
1021471
public void setHTTPProxy(String PROXYNAME, int PROXYPORT) {
		if (PROXYNAME == null) {
			this.proxy_to_use = null;
		}
		else {
			this.proxy_to_use = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(PROXYNAME, PROXYPORT));
		}
	}
513207
public static <V extends VersionedProtocol> V getProxy(Class<V> protocol, InetSocketAddress addr,
			SocketFactory factory) throws IOException {

		@SuppressWarnings("unchecked")
		V proxy = (V) Proxy.newProxyInstance(protocol.getClassLoader(), new Class[] { protocol }, new Invoker(addr, factory));

		return proxy;
	}