Instructs this connection to inherit its streams from the supplied connection object. This
is called by the connection manager when the time comes to pass streams from the authing
connection to the running connection.
545685
protected void inheritStreams (PresentsConnection other)
    {
        _fin = other._fin;
        _oin = other._oin;
        _oout = other._oout;
        if (_loader != null) {
            _oin.setClassLoader(_loader);
        }
    }
431599
def _connect(self):
        
        future = concurrent.Future()

        # Attempt to get a cached connection from the connection pool
        try:
            connection = self._pool_manager.get(self.pid, self)
            self._connections[connection.fileno()] = connection
            future.set_result(connection)

            # Add the connection to the IOLoop
            self._ioloop.add_handler(connection.fileno(),
                                     self._on_io_events,
                                     ioloop.IOLoop.WRITE)
        except pool.NoIdleConnectionsError:
            self._create_connection(future)

        return future
565870
protected B connection(Http2Connection connection) {
        enforceConstraint("connection", "maxReservedStreams", maxReservedStreams);
        enforceConstraint("connection", "server", isServer);
        enforceConstraint("connection", "codec", decoder);
        enforceConstraint("connection", "codec", encoder);

        this.connection = checkNotNull(connection, "connection");

        return self();
    }
1868
@PostConstruct
    public void acquireConnections() throws JMSException {
        LOGGER.debug("Initializing: {}", this.getClass().getCanonicalName());

        connection = connectionFactory.createConnection();
        connection.start();
        jmsSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        producer = jmsSession.createProducer(createDestination());
        eventBus.register(this);
    }
829881
def inherit_type(self, type_cls: Type[TInherit]) \
            -> Union[TInherit, 'Publisher']:
        
        self._inherited_type = type_cls
        return self
218423
function Connection(conn) {
	if(!(this instanceof Connection)) {
		return new Connection(conn);
	}
	var self = this;
	if(!conn) { throw new TypeError("no connection set"); }
	self._connection = conn;
}
988503
synchronized void establishConnection() throws IOException {
        if (isConnected) {
            throw new IOException("Pipe already connected");
        }
        if (buffer == null) { // We may already have allocated the buffer.
            buffer = new byte[PipedInputStream.PIPE_SIZE];
        }
        isConnected = true;
    }
1353006
public void initUpstream()
	{
		for (Conversion conv : getUpstreamConversions(pe.getParticipantOf()))
		{
			ConversionWrapper conW = (ConversionWrapper) graph.getGraphObject(conv);
			if (conW == null) continue;

			if (conv.getConversionDirection() == ConversionDirectionType.REVERSIBLE &&
				conv.getLeft().contains(pe))
			{
				conW = conW.getReverse();
			}
			Edge edge = new EdgeL3(conW, this, graph);
			conW.getDownstreamNoInit().add(edge);
			this.getUpstreamNoInit().add(edge);
		}

		for (Interaction inter : pe.getParticipantOf())
		{
			if (inter instanceof TemplateReaction)
			{
				TemplateReaction tr = (TemplateReaction) inter;
				TemplateReactionWrapper trw = (TemplateReactionWrapper) graph.getGraphObject(tr);
				if (trw == null) continue;

				Edge edge = new EdgeL3(trw, this, graph);

				assert trw.getDownstreamNoInit() != null;

				trw.getDownstreamNoInit().add(edge);
				this.getUpstreamNoInit().add(edge);
			}
		}
	}
951521
protected void finishConnection() {
    this.connector.dispose();
    this.connector = null;
    for (ConnectionListener listener : this.connectionListeners) {
      listener.connectionEnded(this);
    }
    if (this.executors != null) {
      this.executors.destroy();
    }
  }
224085
def on_connect(self, connection):
        ""
        self._stream = connection._reader
        self._buffer = SocketBuffer(self._stream, self._read_size)
        if connection.decode_responses:
            self.encoding = connection.encoding
189909
def connection_factory(self, endpoint, *args, **kwargs):
        
        kwargs = self._make_connection_kwargs(endpoint, kwargs)
        return self.connection_class.factory(endpoint, self.connect_timeout, *args, **kwargs)
35857
function(connectionName, collectionName, options, stream) {

      options = options || {};

      var connectionObject = connections[connectionName];
      if (!connectionObject) return stream.end(Errors.InvalidConnection);

      var collection = connectionObject.collections[collectionName];
      if (!collection) return stream.end(Errors.CollectionNotRegistered);

      collection.stream(options, stream);
    }
1187751
public void initOldStream() {
        //        ContextHolder.getInstance().setContext();
        if (oldStream == null) {
            oldStreamFromPool = false;
            oldStream = new cudaStream_t(nativeOps.createStream());
            //JCuda.cudaStreamCreate(oldStream);

            specialStream = new cudaStream_t(nativeOps.createStream());
            //JCuda.cudaStreamCreate(specialStream);
        }

    }
81374
private static void initStreams() {
		Log.info("Initializing Streams...");
		MetadataCommand command = (MetadataCommand) PreConfigurationContext.getCommandByName("-metadata");
		BatchCommand batchCommand = (BatchCommand) PreConfigurationContext.getCommandByName("-batchSize");
		
		AsyncAnnotationAuditOutputStream asyncAnnotationStream = new AsyncAnnotationAuditOutputStream(
                new AuditProcessOutputStream(Context.getConfigContext()), annotationTransformer);
		
        AuditProcessOutputStream processStream =  new AuditProcessOutputStream(Context.getConfigContext());
        
        
		if (command.isAsync()) {
		    MetadataLookupStream metadataStream;
		    if(batchCommand.getBatchSize() > 0) {
	            BatchProcessStream batchStream = new BatchProcessStream(processStream, batchCommand.getBatchSize());
	            metadataStream = new MetadataLookupStream(batchStream);
		    } else {
		        metadataStream = new MetadataLookupStream(processStream);
		    }
			
			AsyncAuditOutputStream asyncStream = new AsyncAuditOutputStream(metadataStream, asyncAnnotationStream);
			auditStream = new AuditEventOutputStream(asyncStream, configContext);
		} else {
		    AsyncAuditOutputStream asyncStream;
		    if(batchCommand.getBatchSize() > 0) {
                BatchProcessStream batchStream = new BatchProcessStream(processStream, batchCommand.getBatchSize());
                asyncStream = new AsyncAuditOutputStream(batchStream, asyncAnnotationStream);
            } else {
                asyncStream = new AsyncAuditOutputStream(processStream, asyncAnnotationStream);
            }
			MetadataLookupStream metadataStream = new MetadataLookupStream(asyncStream);
			auditStream = new AuditEventOutputStream(metadataStream, configContext);
		}

		Log.info("Audit Streams Initialized.");
	}
87550
public static void transfer(InputStream from, OutputStream to) throws IOException
	{
		from = new BufferedInputStream(requireNotNull(from), BUFFER);
		to = new BufferedOutputStream(requireNotNull(to), BUFFER);

		final byte[] buf = new byte[BUFFER];
		int read;

		while ((read = from.read(buf)) != -1)
		{
			to.write(buf, 0, read);
		}

		to.flush();
	}
93188
public void initiate() throws IOException
    {
        logger.debug("[Stream #{}] Sending stream init for incoming stream", session.planId());
        Socket incomingSocket = session.createConnection();
        incoming.start(incomingSocket, StreamMessage.CURRENT_VERSION);
        incoming.sendInitMessage(incomingSocket, true);

        logger.debug("[Stream #{}] Sending stream init for outgoing stream", session.planId());
        Socket outgoingSocket = session.createConnection();
        outgoing.start(outgoingSocket, StreamMessage.CURRENT_VERSION);
        outgoing.sendInitMessage(outgoingSocket, false);
    }
1069365
function Connection(socket, pool) {
    _classCallCheck(this, Connection);

    this.socket = socket;
    this.id = socket.id;
    this.pool = pool;
    this.incomingFilters = [];
  }