Starts the PeerGroup and begins network activity.
@return A future that completes when first connection activity has been triggered (note: not first connection made).
164476
public ListenableFuture startAsync() {
        // This is run in a background thread by the Service implementation.
        if (chain == null) {
            // Just try to help catch what might be a programming error.
            log.warn("Starting up with no attached block chain. Did you forget to pass one to the constructor?");
        }
        checkState(!vUsedUp, "Cannot start a peer group twice");
        vRunning = true;
        vUsedUp = true;
        executorStartupLatch.countDown();
        // We do blocking waits during startup, so run on the executor thread.
        return executor.submit(new Runnable() {
            @Override
            public void run() {
                try {
                    log.info("Starting ...");
                    channels.startAsync();
                    channels.awaitRunning();
                    triggerConnections();
                    setupPinging();
                } catch (Throwable e) {
                    log.error("Exception when starting up", e);  // The executor swallows exceptions :(
                }
            }
        });
    }
654027
public Action0 getStartAction() {
    return new Action0() {
      @Override
      public void call() {
        if (startTime == null) {
          startTime = new Date().getTime();
        }
      }
    };
  }
928072
public CompletableFuture<Void> open() {
    CompletableFuture<Void> future = new CompletableFuture<>();
    context.executor().execute(() -> register(new RegisterAttempt(1, future)));
    return future;
  }
1232532
@Override
  public ServerImpl start() throws IOException {
    synchronized (lock) {
      checkState(!started, "Already started");
      checkState(!shutdown, "Shutting down");
      // Start and wait for any ports to actually be bound.

      ServerListenerImpl listener = new ServerListenerImpl();
      for (InternalServer ts : transportServers) {
        ts.start(listener);
        activeTransportServers++;
      }
      executor = Preconditions.checkNotNull(executorPool.getObject(), "executor");
      started = true;
      return this;
    }
  }
1075677
public boolean waitForConnectionInit() {
        try {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "waitForConnectionInit: waiting for the H2 connection to complete initialization on " + streamId());
            }
            // the connection isn't initialized yet; wait on the init lock
            boolean rc = muxLink.initLock.await(Constants.H2C_UPGRADE_TIMEOUT, java.util.concurrent.TimeUnit.MILLISECONDS);
            if (rc) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "waitForConnectionInit: stop waiting, H2 connection initialized " + streamId());
                }
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "waitForConnectionInit: stop waiting, timed out waiting for client ");
                }
                muxLink.close(muxLink.initialVC, new ProtocolException("http/2 protocol initialization failed"));
            }
            return rc;
        } catch (InterruptedException e) {
            // server error handled in caller
            return false;
        }
    }
791742
public Future<T> asyncRun()
	{
		final Thread t = new Thread(this);
		{
			t.setName("AsyncRun for " + this);
			t.setDaemon(true);
			t.start();
		}

		return this;
	}
795324
def connect(self):
        ""
        log.info("connecting")

        # don't have the connection attempt reconnects, because when it goes
        # down we are going to cycle to the next potential peer from the Client
        self._peer = connection.Peer(
                None, self._dispatcher, self._addrs.popleft(),
                backend.Socket(), reconnect=False)
        self._peer.start()
931735
public void start(final boolean startPeerCleaningThread) throws IOException {
    logger.info("Starting BitTorrent tracker on {}...",
            getAnnounceUrl());
    connection = new SocketConnection(new ContainerServer(myTrackerServiceContainer));

    List<SocketAddress> tries = new ArrayList<SocketAddress>() {{
      try {
        add(new InetSocketAddress(InetAddress.getByAddress(new byte[4]), myPort));
      } catch (Exception ex) {
      }
      try {
        add(new InetSocketAddress(InetAddress.getLocalHost(), myPort));
      } catch (Exception ex) {
      }
      try {
        add(new InetSocketAddress(InetAddress.getByName(new URL(getAnnounceUrl()).getHost()), myPort));
      } catch (Exception ex) {
      }
    }};

    boolean started = false;
    for (SocketAddress address : tries) {
      try {
        if ((myBoundAddress = connection.connect(address)) != null) {
          logger.info("Started torrent tracker on {}", address);
          started = true;
          break;
        }
      } catch (IOException ioe) {
        logger.info("Can't start the tracker using address{} : ", address.toString(), ioe.getMessage());
      }
    }
    if (!started) {
      logger.error("Cannot start tracker on port {}. Stopping now...", myPort);
      stop();
      return;
    }
    if (startPeerCleaningThread) {
      if (myPeerCollectorThread == null || !myPeerCollectorThread.isAlive() || myPeerCollectorThread.getState() != Thread.State.NEW) {
        myPeerCollectorThread = new PeerCollectorThread(myTorrentsRepository);
      }

      myPeerCollectorThread.setName("peer-peerCollectorThread:" + myPort);
      myPeerCollectorThread.start();
    }
  }
60647
public CompletableFuture<Void> snapshot() {
    return Futures.allOf(config.getMembers().stream()
        .map(MemberId::from)
        .map(id -> communicationService.send(snapshotSubject, null, id, SNAPSHOT_TIMEOUT))
        .collect(Collectors.toList()))
        .thenApply(v -> null);
  }
1258503
public Socket createConnection(InetAddress peer) throws IOException
    {
        int attempts = 0;
        while (true)
        {
            try
            {
                Socket socket = OutboundTcpConnectionPool.newSocket(peer);
                socket.setSoTimeout(DatabaseDescriptor.getStreamingSocketTimeout());
                socket.setKeepAlive(true);
                return socket;
            }
            catch (IOException e)
            {
                if (++attempts >= MAX_CONNECT_ATTEMPTS)
                    throw e;

                long waitms = DatabaseDescriptor.getRpcTimeout() * (long)Math.pow(2, attempts);
                logger.warn("Failed attempt " + attempts + " to connect to " + peer + ". Retrying in " + waitms + " ms. (" + e + ")");
                try
                {
                    Thread.sleep(waitms);
                }
                catch (InterruptedException wtf)
                {
                    throw new IOException("interrupted", wtf);
                }
            }
        }
    }
344358
public void start() throws Exception
    {
        Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Cannot be started more than once");

        startTask.set(AfterConnectionEstablished.execute(client, new Runnable()
                {
                    @Override
                    public void run()
                    {
                        try
                        {
                            internalStart();
                        }
                        finally
                        {
                            startTask.set(null);
                        }
                    }
                }));
    }
797625
public Project.Layouts.Layout.NetworkLines.NetworkActivity createProjectLayoutsLayoutNetworkLinesNetworkActivity()
   {
      return new Project.Layouts.Layout.NetworkLines.NetworkActivity();
   }
1239522
public CompletableFuture<E> nextEvent() {
    E event = events.poll();
    if (event != null) {
      return CompletableFuture.completedFuture(event);
    } else {
      CompletableFuture<E> future = new CompletableFuture<>();
      futures.add(future);
      return future;
    }
  }
460351
@Override
    public synchronized void gossiperStarting()
    {
        gossiperInitialized = true;
        StorageService.instance.gossipSnitchInfo();
        Gossiper.instance.register(new ReconnectableSnitchHelper(this, localNodeData.datacenter, true));
    }
317581
public JwwfServer startAndJoin() {
		try {
			server.start();
			server.join();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return this;
	}
295683
public void start()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "start");

    if(!started)
    {
      started = true;
      if(keyGroup != null)
        keyGroup.startMember();
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "start");
  }
1014806
public CompletableFuture<Void> open() {
    return primaryElection.getTerm()
        .thenAccept(this::changeRole)
        .thenRun(() -> service.init(this));
  }