Examples of connect()


Examples of org.apache.commons.net.smtp.SMTPSClient.connect()

        try {
            server = createServer(createProtocol(new ProtocolHandler[0]), address, Encryption.createStartTls(BogusSslContextFactory.getServerContext()))
            server.bind();
           
            SMTPSClient client = createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
           
            client.sendCommand("EHLO localhost");
            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
           
View Full Code Here

Examples of org.apache.commons.net.telnet.TelnetClient.connect()

        try {
            final TelnetClient tc = new TelnetClient();
            tc.setConnectTimeout(connectionTimeoutMillis);
            tc.addOptionHandler(new WindowSizeOptionHandler(299, 25, true, false, true, false));
            logger.info("Connecting to telnet://{}@{}", username, address);
            tc.connect(address, port);
            final InputStream stdout = tc.getInputStream();
            final OutputStream stdin = tc.getOutputStream();
            final PipedInputStream callersStdout = new PipedInputStream();
            final PipedOutputStream toCallersStdout = new PipedOutputStream(callersStdout);
            final ByteArrayOutputStream outputBuf = new ByteArrayOutputStream();
View Full Code Here

Examples of org.apache.commons.net.time.TimeTCPClient.connect()

    {
        TimeTCPClient client = new TimeTCPClient();

        // We want to timeout if a response takes longer than 60 seconds
        client.setDefaultTimeout(60000);
        client.connect(host);
        System.out.println(client.getDate().toString());
        client.disconnect();
    }

    public static final void timeUDP(String host) throws IOException
View Full Code Here

Examples of org.apache.commons.net.whois.WhoisClient.connect()

        System.out.println("[" + address.getHostName() + "]");

        try
        {
            whois.connect(address);
            System.out.print(whois.query(handle));
            whois.disconnect();
        }
        catch (IOException e)
        {
View Full Code Here

Examples of org.apache.derby.jdbc.EmbeddedDriver.connect()

        if (_needDerbyShutdown) {
            __log.debug("shutting down derby.");
            EmbeddedDriver driver = new EmbeddedDriver();
            try {
                driver.connect(_derbyUrl + ";shutdown=true", new Properties());
            } catch (SQLException ex) {
                // Shutdown will always return an exeption!
                if (ex.getErrorCode() != 45000)
                    __log.error("Error shutting down Derby: " + ex.getErrorCode(), ex);
View Full Code Here

Examples of org.apache.derby.jdbc.InternalDriver.connect()

   */
  private static Connection getDefaultConn()throws SQLException
  {
    InternalDriver id = InternalDriver.activeDriver();
    if (id != null) {
      Connection conn = id.connect("jdbc:default:connection", null);
      if (conn != null)
        return conn;
    }
    throw Util.noCurrentConnection();
  }
View Full Code Here

Examples of org.apache.directory.ldap.client.api.LdapConnection.connect()

        try
        {
            LdapServer ldapServer = createLdapServerRule.getLdapServer();
            ldapServer.getPort();
            ldapConnection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
            ldapConnection.connect();
            ldapConnection.bind( "uid=admin,ou=system", "secret" );
   
            Dn dn = new Dn( "cn=methodDs,ou=system" );
            Entry entry = ldapConnection.lookup( dn );
            assertNotNull( entry );
View Full Code Here

Examples of org.apache.directory.ldap.client.api.LdapNetworkConnection.connect()

        @SuppressWarnings("unchecked")
        final Callable<Boolean> timeLimitedConnection = timeLimiter.newProxy(
                new Callable<Boolean>() {
                    @Override
                    public Boolean call() throws Exception {
                        return connection.connect();
                    }
                }, Callable.class,
                connectionTimeout, TimeUnit.MILLISECONDS);
        try {
            final Boolean connected = timeLimitedConnection.call();
View Full Code Here

Examples of org.apache.directory.ldapstudio.proxy.model.LdapProxy.connect()

            LdapProxy ldapProxy = new LdapProxy( connectWizard.getLocalPort(), connectWizard.getRemoteHost(),
                connectWizard.getRemotePort() );
            view.setLdapProxy( ldapProxy );
            try
            {
                ldapProxy.connect();
            }
            catch ( IOException e )
            {
                // TODO Auto-generated catch block
                e.printStackTrace();
View Full Code Here

Examples of org.apache.directory.server.ldap.replication.consumer.ReplicationConsumer.connect()

                    DirectoryService directoryService = new MockDirectoryService();
                    directoryService.setSchemaManager( schemaManager );
                    ( ( MockSyncReplConsumer ) syncreplClient ).init( directoryService );
                   
                    directoryService.setDnFactory( new DefaultDnFactory( schemaManager, null ) );
                    syncreplClient.connect( true );
                    syncreplClient.startSync();
                }
                catch ( Exception e )
                {
                    throw new RuntimeException( e );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.