Examples of connect()


Examples of org.apache.commons.net.echo.EchoTCPClient.connect()

        PrintWriter echoOutput;
        String line;

        // We want to timeout if a response takes longer than 60 seconds
        client.setDefaultTimeout(60000);
        client.connect(host);
        System.out.println("Connected to " + host + ".");
        input = new BufferedReader(new InputStreamReader(System.in));
        echoOutput =
            new PrintWriter(new OutputStreamWriter(client.getOutputStream()), true);
        echoInput =
View Full Code Here

Examples of org.apache.commons.net.finger.FingerClient.connect()

                System.exit(1);
            }

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

Examples of org.apache.commons.net.ftp.FTPClient.connect()

        server.stop();
        initServer();
       
        // let's generate some stats
        FTPClient client1 = new FTPClient();
        client1.connect("localhost", getListenerPort());
       
        assertTrue(client1.login(ADMIN_USERNAME, ADMIN_PASSWORD));
        assertTrue(client1.makeDirectory("foo"));
        assertTrue(client1.makeDirectory("foo2"));
        assertTrue(client1.removeDirectory("foo2"));
View Full Code Here

Examples of org.apache.commons.net.ftp.FTPSClient.connect()

                    client.setParserFactory(myFactory);
                }

                try
                {
                    client.connect(hostname, port);

                    int reply = client.getReplyCode();
                    if (!FTPReply.isPositiveCompletion(reply))
                    {
                        throw new FileSystemException("vfs.provider.ftp/connect-rejected.error", hostname);
View Full Code Here

Examples of org.apache.commons.net.imap.IMAPClient.connect()

        // suppress login details
        imap.addProtocolCommandListener(new PrintCommandListener(System.out, true));

        try
        {
            imap.connect(server);
        }
        catch (IOException e)
        {
            throw new RuntimeException("Could not connect to server.", e);
        }
View Full Code Here

Examples of org.apache.commons.net.nntp.NNTPClient.connect()

      if (monitor.isCanceled())
        return null;

      /* Connect to Server */
      if (link.getPort() != -1)
        client.connect(link.getHost(), link.getPort());
      else
        client.connect(link.getHost());

      /* Set Timeout */
      setTimeout(client, properties);
View Full Code Here

Examples of org.apache.commons.net.pop3.POP3Client.connect()

    messages.put("headers", RestV2IT.addMessage(EMAIL_REGULAR, labelId));
    messages.put("attach", RestV2IT.addMessage(EMAIL_LARGE_ATT, labelId));

    // initialize POP3 client
    POP3Client client = new POP3Client();
    client.connect(POP3_HOST, POP3_PORT);

    // Login
    boolean loginSuccess = client.login(TEST_ACCOUNT, TEST_PASSWORD);
    assertThat(loginSuccess, is(true));
View Full Code Here

Examples of org.apache.commons.net.pop3.POP3SClient.connect()

            handler.add("valid", new MockMailbox(identifier));
            server = createServer(createProtocol(handler), address, Encryption.createStartTls(BogusSslContextFactory.getServerContext()));
            server.bind();
           
            POP3SClient client = createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
           
            // TODO: Make use of client.capa() once possible
            //       See NET-438
            assertEquals(POP3Reply.OK, client.sendCommand("CAPA"));
            client.getAdditionalReply();
View Full Code Here

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

    if (smtpEncryption == Encryption.SSL) {
      client.enableSSL(sslVerify);
    }

    try {
      client.connect(smtpHost, smtpPort);
      if (!SMTPReply.isPositiveCompletion(client.getReplyCode())) {
        throw new EmailException("SMTP server rejected connection");
      }
      if (!client.login()) {
        String e = client.getReplyString();
View Full Code Here

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

            client = new SMTPClient();
            client.addProtocolCommandListener(new PrintCommandListener(
                                                  new PrintWriter(System.out)));

            client.connect(server);

            if (!SMTPReply.isPositiveCompletion(client.getReplyCode()))
            {
                client.disconnect();
                System.err.println("SMTP server refused connection.");
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.