Examples of disconnect()


Examples of org.apache.commons.net.daytime.DaytimeTCPClient.disconnect()

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

    public static final void daytimeUDP(String host) throws IOException
    {
        DaytimeUDPClient client = new DaytimeUDPClient();
View Full Code Here

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

        {
            echoOutput.println(line);
            System.out.println(echoInput.readLine());
        }

        client.disconnect();
    }

    public static final void echoUDP(String host) throws IOException
    {
        int length, count;
View Full Code Here

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

            try
            {
                finger.connect(address);
                System.out.print(finger.query(longOutput));
                finger.disconnect();
            }
            catch (IOException e)
            {
                System.err.println("Error I/O exception: " + e.getMessage());
                System.exit(1);
View Full Code Here

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

        assertTrue(client1.storeFile(TEST_FILENAME, new ByteArrayInputStream(TESTDATA)));
        assertTrue(client1.retrieveFile(TEST_FILENAME, new ByteArrayOutputStream()));
        assertTrue(client1.deleteFile(TEST_FILENAME));
       
        assertTrue(client1.logout());
        client1.disconnect();

        FTPClient client2 = new FTPClient();
        client2.connect("localhost", getListenerPort());

        assertTrue(client2.login(ANONYMOUS_USERNAME, ANONYMOUS_PASSWORD));
View Full Code Here

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

                }
                catch (final IOException e)
                {
                    if (client.isConnected())
                    {
                        client.disconnect();
                    }
                    throw e;
                }

                return client;
View Full Code Here

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

        try
        {
            if (!imap.login(username, password))
            {
                System.err.println("Could not login to server. Check password.");
                imap.disconnect();
                System.exit(3);
            }

            imap.setSoTimeout(6000);
View Full Code Here

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

    /* Disconnect */
    finally {
      try {
        if (client.isConnected())
          client.disconnect();
      } catch (IOException e) {
        throw new ConnectionException(Activator.getDefault().createErrorStatus(e.getMessage(), e));
      }
    }

View Full Code Here

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

        try
        {
            if (!pop3.login(username, password))
            {
                System.err.println("Could not login to server.  Check password.");
                pop3.disconnect();
                System.exit(1);
            }

            messages = pop3.listMessages();
View Full Code Here

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

            assertTrue(client.execTLS());
            // TODO: Reenable when commons-net 3.1.0 was released
            //       See NET-430
            //
            //assertTrue(client.logout());
            client.disconnect();
          
        } finally {
            if (server != null) {
                server.unbind();
            }
View Full Code Here

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

        throw new EmailException("SMTP server rejected auth: " + e);
      }
    } catch (IOException e) {
      if (client.isConnected()) {
        try {
          client.disconnect();
        } catch (IOException e2) {
        }
      }
      throw new EmailException(e.getMessage(), e);
    } catch (EmailException 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.