/* (non-Javadoc)
@see tuwien.auto.calimero.mgmt.TransportLayer#connect
(tuwien.auto.calimero.mgmt.Destination)
191728
public void connect(Destination d) throws KNXTimeoutException, KNXLinkClosedException
	{
		final AggregatorProxy p = getProxy(d);
		if (!d.isConnectionOriented()) {
			logger.error("destination not connection oriented: " + d.getAddress());
			return;
		}
		if (d.getState() != Destination.DISCONNECTED)
			return;
		p.setState(Destination.CONNECTING);
		final byte[] tpdu = new byte[] { (byte) CONNECT };
		lnk.sendRequestWait(d.getAddress(), Priority.SYSTEM, tpdu);
		p.setState(Destination.OPEN_IDLE);
		logger.trace("connected with " + d.getAddress());
	}
1194441
@Override
    public void transportClosed(boolean closedByRemotePeer, boolean mayBlock)
    {
    	parentListener.unregisterClient(this);
        try
        {
            if (localConnection != null)
                localConnection.close();
        }
        catch (Exception e)
        {
            log.error("#"+id+" Could not close local connection",e);
        }
        finally
        {
        	localConnection = null;
        }
    }
23824
public void reconstitute(BaseDestinationHandler destinationHandler) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "reconstitute", destinationHandler); 

    super.reconstitute(destinationHandler);
      
    _destHighMsgs = destinationHandler.getMessageProcessor().getHighMessageThreshold();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.exit(tc, "reconstitute");           
    }
  }
164454
void connect(boolean reconnectOnConnect) throws InterruptedException, IOException {
        if (options.getServers().size() == 0) {
            throw new IllegalArgumentException("No servers provided in options");
        }

        for (String serverURI : getServers()) {

            if (isClosed()) {
                break;
            }

            updateStatus(Status.CONNECTING);

            tryToConnect(serverURI);

            if (isConnected()) {
                break;
            } else {
                updateStatus(Status.DISCONNECTED);
            }
        }

        if (!isConnected() && !isClosed()) {
            if (reconnectOnConnect) {
                reconnect();
            } else {
                close();
                throw new IOException("Unable to connect to gnatsd server.");
            }
        }
    }
337777
def connection_made(self, transport):
        
        self.transport = transport
        self.transport.sendto(self.message)
        self.transport.close()
373000
public void connect(Object context) throws Exception {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "connect");
        }

        this.syncObject = new SimpleSync();

        // reset proxy response object
        if (this.proxy != null) {
            this.proxy.setIsProxyResponseValid(false);
        }

        this.syncError = null;
        connectCommon((TCPConnectRequestContext) context);

        if (this.syncError != null) {
            throw this.syncError;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "connect");
        }
    }
601398
public void connect(String eventSourceUrl) throws IOException {
        LOG.entering(CLASS_NAME, "connect", eventSourceUrl);
        _getDelegate().connect(eventSourceUrl);
    }
502158
@Override
	public final void send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
    {
    	if (this.destination == null)
    		throw new UnsupportedOperationException("Destination was not set at creation time");

        // Setup message fields
    	setupMessage(destination,message,deliveryMode,priority,timeToLive);
    	
    	// Handle foreign message implementations
        message = MessageTools.normalize(message);
        
    	sendToDestination(destination,false,message,deliveryMode,priority,timeToLive);
    }
1036133
public void addConnection(RedisURI redisURI, CompletableFuture<StatefulRedisConnection<String, String>> connection) {
        connections.put(redisURI, connection);
    }
1236962
public static void connect(String path, String acceptType, Route route) {
        getInstance().connect(path, acceptType, route);
    }
126041
public void dispatchDestinationListenerEvent(SICoreConnection conn, SIDestinationAddress destinationAddress,
         DestinationAvailability destinationAvailability, DestinationListener destinationListener)
   {
      if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dispatchDestinationListenerEvent",
            new Object[]{conn, destinationAddress, destinationAvailability, destinationListener});

      //Create a new DestinationListenerThread and dispatch it.
      final DestinationListenerThread thread = new DestinationListenerThread(conn, destinationAddress, destinationAvailability, destinationListener);
      dispatchThread(thread);

      if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dispatchDestinationListenerEvent");
   }
703446
@SuppressWarnings("unchecked")
  protected <R> void connect(final EtcdRequest<R> etcdRequest) throws IOException {
    this.connect(etcdRequest, etcdRequest.getPromise().getConnectionState());
  }
146151
def connect(self, interface, event, handler):
        """"""
        object_path = self.object_path
        return self.bus.connect(interface, event, object_path, handler)
342563
@Override
    public Connection connect( String url,
                               Properties info ) throws SQLException {
        if (!acceptsURL(url)) {
            return null;
        }
        RepositoryDelegate repositoryDelegate = delegateFactory.createRepositoryDelegate(url, info, this.contextFactory);
        return repositoryDelegate.createConnection(getDriverInfo());
    }
383098
public void connectServer(Connection connection) {
    threadContext.checkThread();

    // Handlers for all request types are registered since requests can be proxied between servers.
    // Note we do not use method references here because the "state" variable changes over time.
    // We have to use lambdas to ensure the request handler points to the current state.
    connection.handler(RegisterRequest.class, (Function<RegisterRequest, CompletableFuture<RegisterResponse>>) request -> state.register(request));
    connection.handler(ConnectRequest.class, (Function<ConnectRequest, CompletableFuture<ConnectResponse>>) request -> state.connect(request, connection));
    connection.handler(KeepAliveRequest.class, (Function<KeepAliveRequest, CompletableFuture<KeepAliveResponse>>) request -> state.keepAlive(request));
    connection.handler(UnregisterRequest.class, (Function<UnregisterRequest, CompletableFuture<UnregisterResponse>>) request -> state.unregister(request));
    connection.handler(ResetRequest.class, (Consumer<ResetRequest>) request -> state.reset(request));
    connection.handler(ConfigureRequest.class, (Function<ConfigureRequest, CompletableFuture<ConfigureResponse>>) request -> state.configure(request));
    connection.handler(InstallRequest.class, (Function<InstallRequest, CompletableFuture<InstallResponse>>) request -> state.install(request));
    connection.handler(JoinRequest.class, (Function<JoinRequest, CompletableFuture<JoinResponse>>) request -> state.join(request));
    connection.handler(ReconfigureRequest.class, (Function<ReconfigureRequest, CompletableFuture<ReconfigureResponse>>) request -> state.reconfigure(request));
    connection.handler(LeaveRequest.class, (Function<LeaveRequest, CompletableFuture<LeaveResponse>>) request -> state.leave(request));
    connection.handler(AppendRequest.class, (Function<AppendRequest, CompletableFuture<AppendResponse>>) request -> state.append(request));
    connection.handler(PollRequest.class, (Function<PollRequest, CompletableFuture<PollResponse>>) request -> state.poll(request));
    connection.handler(VoteRequest.class, (Function<VoteRequest, CompletableFuture<VoteResponse>>) request -> state.vote(request));
    connection.handler(CommandRequest.class, (Function<CommandRequest, CompletableFuture<CommandResponse>>) request -> state.command(request));
    connection.handler(QueryRequest.class, (Function<QueryRequest, CompletableFuture<QueryResponse>>) request -> state.query(request));

    connection.onClose(stateMachine.executor().context().sessions()::unregisterConnection);
  }
187364
@Override
    public void setDestination(SIDestinationAddress destinationAddr)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "setDestination", destinationAddr);

        if (destinationAddr != null)
        {
            try
            {
                _originalDestination = _messageProcessor.getDestinationManager().getDestination((JsDestinationAddress) destinationAddr, true);
            } catch (SIException e)
            {
                // No FFDC code needed

                /* Generate warning but retry with default exception destination */
                SibTr.warning(tc, "EXCEPTION_DESTINATION_WARNING_CWSIP0291",
                              new Object[] { destinationAddr.getDestinationName(), _messageProcessor.getMessagingEngineName(), e });

                // Create a handler to the default if provided destination is inaccessible
                _originalDestination = null;
            }
        }
        else
            _originalDestination = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "setDestination", _originalDestination);
    }
1352340
@Deprecated
    public void connect(Object from, String from_out, Object to, String to_in) {
        controller.connect(from, from_out, to, to_in);
    }