Sends initial connection window to the remote endpoint if necessary.
483591
private void sendInitialConnectionWindow() throws Http2Exception {
    if (ctx.channel().isActive() && initialConnectionWindow > 0) {
      Http2Stream connectionStream = connection().connectionStream();
      int currentSize = connection().local().flowController().windowSize(connectionStream);
      int delta = initialConnectionWindow - currentSize;
      decoder().flowController().incrementWindowSize(connectionStream, delta);
      initialConnectionWindow = -1;
      ctx.flush();
    }
  }
1138360
private void sendRegisterRequest() {
    StreamManager.RegisterInstanceRequest request =
        StreamManager.RegisterInstanceRequest.newBuilder().
            setInstance(instance).setTopologyName(topologyName).setTopologyId(topologyId).
            build();

    // The timeout would be the reconnect-interval-seconds
    sendRequest(request, null,
        StreamManager.RegisterInstanceResponse.newBuilder(),
        systemConfig.getInstanceReconnectStreammgrInterval());
  }
750797
@PostConstruct
    protected void startRTMAndWebSocketConnection() {
        slackService.connectRTM(getSlackToken());
        if (slackService.getWebSocketUrl() != null) {
            webSocketManager = new WebSocketConnectionManager(client(), handler(), slackService.getWebSocketUrl());
            webSocketManager.start();
        } else {
            logger.error("No web socket url returned by Slack.");
        }
    }
234228
public void openSession(SocketAddress endpoint) {
        synchronized (lock) {
            // Submit a reconnect task for this address if one is not already present
            if (!pendingConnections.containsKey(endpoint)) {
                final ReconnectTask task = new ReconnectTask(endpoint);
                pendingConnections.put(endpoint, task);
                this.reconnectExecutor.submit(task);
            }
        }
    }
80685
def _launch_remote(self, host, config_port, race, name, interface):
    """"""
    self._tcp_conn, settings = tcp_client(Addr(host, config_port))

    self._map_name = settings["map_name"]

    if settings["remote"]:
      self._udp_sock = udp_server(
          Addr(host, settings["ports"]["server"]["game"]))

      daemon_thread(tcp_to_udp,
                    (self._tcp_conn, self._udp_sock,
                     Addr(host, settings["ports"]["client"]["game"])))

      daemon_thread(udp_to_tcp, (self._udp_sock, self._tcp_conn))

    extra_ports = [
        settings["ports"]["server"]["game"],
        settings["ports"]["server"]["base"],
        settings["ports"]["client"]["game"],
        settings["ports"]["client"]["base"],
    ]

    self._sc2_procs = [self._run_config.start(
        extra_ports=extra_ports, host=host, version=settings["game_version"],
        window_loc=(700, 50), want_rgb=interface.HasField("render"))]
    self._controllers = [p.controller for p in self._sc2_procs]

    # Create the join request.
    join = sc_pb.RequestJoinGame(options=interface)
    join.race = race
    join.player_name = name
    join.shared_port = 0  # unused
    join.server_ports.game_port = settings["ports"]["server"]["game"]
    join.server_ports.base_port = settings["ports"]["server"]["base"]
    join.client_ports.add(game_port=settings["ports"]["client"]["game"],
                          base_port=settings["ports"]["client"]["base"])

    self._controllers[0].save_map(settings["map_path"], settings["map_data"])
    self._controllers[0].join_game(join)
740102
private void startConnection()
  {
    while (doStart()) {
      boolean isValid = false;

      try {
        long now = currentTimeActual();

        updateIdleExpireTime(now);

        int id = _gId.incrementAndGet();
        
        updateThrottle();

        /*
        if (id == 200) {
          ThreadDump.create().dumpThreads();
        }
        else */ 
        /*
        if (id == 1000) {
          ThreadDump.create().dumpThreads();
        }
        */

        launchChildThread(id);
        
        isValid = true;
      } finally {
        if (! isValid) {
          onStartFail();
        }
      }
    }
  }
395645
public void sendStart() throws SIConnectionDroppedException, SIConnectionLostException {                     //471642
     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start");
     sendStart(false);            // Always use proper start
     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
   }
744633
def connect(endpoint)
      rc = ffi_delegate.connect("%s", :string, endpoint)
      raise ArgumentError, "incorrect endpoint: %p" % endpoint if rc == -1
    end
934935
def preinitialize(addr, port, *args)
      @_write_buffer = ::IO::Buffer.new # allow for writing BEFORE DNS has resolved
      @remote_host, @remote_addr, @remote_port = addr, addr, port
      @_resolver = TCPConnectResolver.new(self, addr, port, *args)
    end
1371677
protected void remoteInit() throws JMSException
    {
        QueueBrowserGetEnumerationQuery query = new QueueBrowserGetEnumerationQuery();
        query.setSessionId(session.getId());
        query.setBrowserId(browser.getId());
        QueueBrowserGetEnumerationResponse response = (QueueBrowserGetEnumerationResponse)transportEndpoint.blockingRequest(query);
        this.id = response.getEnumId();
        log.debug("Remote queue browser enumeration ID is "+id);
    }
1012072
def connection_settings(frame)
      connection_error unless frame[:type] == :settings && (frame[:stream]).zero?

      # Apply settings.
      #  side =
      #   local: previously sent and pended our settings should be effective
      #   remote: just received peer settings should immediately be effective
      settings, side = if frame[:flags].include?(:ack)
        # Process pending settings we have sent.
        [@pending_settings.shift, :local]
      else
        connection_error(check) if validate_settings(@remote_role, frame[:payload])
        [frame[:payload], :remote]
      end

      settings.each do |key, v|
        case side
        when :local
          @local_settings[key] = v
        when :remote
          @remote_settings[key] = v
        end

        case key
        when :settings_max_concurrent_streams
          # Do nothing.
          # The value controls at the next attempt of stream creation.

        when :settings_initial_window_size
          # A change to SETTINGS_INITIAL_WINDOW_SIZE could cause the available
          # space in a flow control window to become negative. A sender MUST
          # track the negative flow control window, and MUST NOT send new flow
          # controlled frames until it receives WINDOW_UPDATE frames that cause
          # the flow control window to become positive.
          case side
          when :local
            @local_window = @local_window - @local_window_limit + v
            @streams.each do |_id, stream|
              stream.emit(:local_window, stream.local_window - @local_window_limit + v)
            end

            @local_window_limit = v
          when :remote
            @remote_window = @remote_window - @remote_window_limit + v
            @streams.each do |_id, stream|
              # Event name is :window, not :remote_window
              stream.emit(:window, stream.remote_window - @remote_window_limit + v)
            end

            @remote_window_limit = v
          end

        when :settings_header_table_size
          # Setting header table size might cause some headers evicted
          case side
          when :local
            @compressor.table_size = v
          when :remote
            @decompressor.table_size = v
          end

        when :settings_enable_push
          # nothing to do

        when :settings_max_frame_size
          # nothing to do

          # else # ignore unknown settings
        end
      end

      case side
      when :local
        # Received a settings_ack.  Notify application layer.
        emit(:settings_ack, frame, @pending_settings.size)
      when :remote
        unless @state == :closed || @h2c_upgrade == :start
          # Send ack to peer
          send(type: :settings, stream: 0, payload: [], flags: [:ack])
        end
      end
    end
1109873
function Connection (remote, options) {
  EventEmitter.call(this);

  if (remote[remote.length - 1] === '/') {
    remote = remote.substr(0, remote.length - 1);
  }

  this._remote = remote;
  this._retry = options.retry || 3;
  this._options = options || {};
  this._request_internal = createInternalConnection(options.mode);
}
492524
def send_remote_port(self):
        
        msg = "REMOTE TCP %s" % (str(self.transport.getPeer().port))
        self.send_line(msg)
213710
private void sendRequest(InvocationRequest helpRequest, boolean startRemoteViewer) {
        this.helpRequest = helpRequest;
        
        if (helpRequest != null) {
            if (remoteViewerActive()) {
                remoteQueue.sendRequest(helpRequest);
                this.helpRequest = null;
            } else if (startRemoteViewer) {
                startRemoteViewer();
            } else {
                this.helpRequest = null;
            }
        }
    }
378363
public synchronized void doStop() {
        if(_connection != null) {
            delegate.getLogger().debug("stomp: closing connection to remote broker");
            try {transmit(CMD_DISCONNECT, null, null, null, null);} catch (IOException ioe) {/* ignore it */}
            final IStreamConnection c= _connection;
            _connection= null;
            c.close();
            
            try {
                _receiver.stop();
                _receiver.waitForState(2000, AbstractSingleThreadRunner.STOPPED);
            } catch (InterruptedException ie) {
                delegate.getLogger().warn("stomp: could not stop receiver", ie);
            }
            
            _transformer= null;
        }
    }
590333
async def start(self, remoteParameters):
        
        if self.state == 'closed':
            raise InvalidStateError('RTCIceTransport is closed')

        # handle the case where start is already in progress
        if self.__start is not None:
            return await self.__start.wait()
        self.__start = asyncio.Event()

        self.__setState('checking')
        self._connection.remote_username = remoteParameters.usernameFragment
        self._connection.remote_password = remoteParameters.password
        try:
            await self._connection.connect()
        except ConnectionError:
            self.__setState('failed')
        else:
            self.__setState('completed')
        self.__start.set()
210817
ChannelFuture connect(final InetSocketAddress serverSocketAddress) {
		checkState(bootstrap != null, "Client has not been initialized yet.");

		// --------------------------------------------------------------------
		// Child channel pipeline for accepted connections
		// --------------------------------------------------------------------

		bootstrap.handler(new ChannelInitializer<SocketChannel>() {
			@Override
			public void initChannel(SocketChannel channel) throws Exception {

				// SSL handler should be added first in the pipeline
				if (clientSSLFactory != null) {
					SslHandler sslHandler = clientSSLFactory.createNettySSLHandler(
							serverSocketAddress.getAddress().getCanonicalHostName(),
							serverSocketAddress.getPort());
					channel.pipeline().addLast("ssl", sslHandler);
				}
				channel.pipeline().addLast(protocol.getClientChannelHandlers());
			}
		});

		try {
			return bootstrap.connect(serverSocketAddress);
		}
		catch (ChannelException e) {
			if ((e.getCause() instanceof java.net.SocketException &&
					e.getCause().getMessage().equals("Too many open files")) ||
				(e.getCause() instanceof ChannelException &&
						e.getCause().getCause() instanceof java.net.SocketException &&
						e.getCause().getCause().getMessage().equals("Too many open files")))
			{
				throw new ChannelException(
						"The operating system does not offer enough file handles to open the network connection. " +
								"Please increase the number of available file handles.", e.getCause());
			}
			else {
				throw e;
			}
		}
	}