seshasathish
Validate telnet connectivity
2 Answer(s)      4 years and 3 months ago
Posted in : Java Beginners

How to validate telnet connectivity in my java code

Advertisement
View Answers

March 2, 2011 at 9:58 AM


urgent-please help "How to validate telnet connectivity in my java code"



March 8, 2011 at 3:17 PM


import java.io.*;
import java.net.*;
import java.util.*;
import java.util.TimerTask;
import org.apache.commons.net.telnet.TelnetClient;
class Connectivity extends TimerTask
{
    public static void main(String args[])
    {
        try
        {
            System.out.println("Please enter ip address");
            Scanner sc=new Scanner(System.in);
            String ip=sc.nextLine().trim();
            System.out.println("Please enter port number");
            TimerTask con  = new Connectivity();
            Scanner sc1=new Scanner(System.in);
            int port=sc1.nextInt();
            Timer timer = new Timer();
            timer.scheduleAtFixedRate(con,1,1000);
            Socket s1=new Socket(ip,port);
            InputStream is=s1.getInputStream();
            DataInputStream dis=new DataInputStream(is);
            if(dis!=null)
            {
                System.out.println("Connected with ip "+ip+" and port "+port);
            }
            else
            {
                System.out.println("Connection invalid");
            }

            dis.close();
            s1.close();

        }
        catch(Exception e)
        {
            System.out.println("Not Connected,Please enter proper input");

        }

    }

    @Override
    public void run() {
        // TODO Auto-generated method stub

    }
}









Related Tutorials/Questions & Answers:
Validate telnet connectivity
Validate telnet connectivity  How to validate telnet connectivity in my java code
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..  Dear sir... 2)code in jsp to validate the username and password of my gmail mentioned above
Advertisements
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..  Dear sir... 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..  Dear sir... 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..  Dear sir... 2)code in jsp to validate the username and password of my gmail mentioned above
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..  Dear sir... 2)code in jsp to validate the username and password of my gmail mentioned above
Validate
Validate   hi all..im a beginner java and i need some help from u guys.. Its about validate. My HR request BF = 'brought forward', leave cannot apply date greater than 31/03 of particular year. So, if the user apply the date
How to transfer a file in java using SSH & Telnet
How to transfer a file in java using SSH & Telnet  How to transfer a file in java using SSH & Telnet
Remote file transfer in java using SSH & Telnet
Remote file transfer in java using SSH & Telnet  How to upload & download a file in java using SSH & Telnet
long validate
long validate  How to validate long type
JavaScript regex validate validate Zip.
JavaScript regex validate validate Zip.  JavaScript regex validate - how to validate Zip?   <html> <head> <title>Zip Code...; function validate() { var zip = document.getElementById("zip").value
database connectivity
database connectivity  how to create database connectivity between HTML and sql server2005
database connectivity
database connectivity  describe java program steps in order to get connectivity to database along with example
connectivity with php
connectivity with php  i have make one html form and doing connectivity with php database but when i click on submit button on html form display all coding in php form about connectivity instead of adding data, i used in html
java connectivity
java connectivity  hi........ Can u help me to do connectivity between java and weka??????? weka is a data mining tool which allows to do prediction, classification etc.... i want to do connectivity between weka and java can u
connectivity problem
connectivity problem  i am facing error in Class.for name statement... connectivity still i am facing this error* ================================oracle connectivity program============================ import java.sql.*; import
Java connectivity with MySQL
Java connectivity with MySQL  Java connectivity with MySQL
connectivity with mysql
connectivity with mysql  if this code of roseindia doesnt work,then what to do..cant connect with my sql http://www.roseindia.net/tutorial/php/phpdatabase/Check-PHP-MySQL-Connectivity.html   Please visit the following
JDBC CONNECTIVITY
file in environment variable.   Java Mysql connectivity Other JDBC
connectivity with access
connectivity with access  how to connect with data base with access sheet. in my application form there is two JTextArea and Two JComboBox.   Is this Access database or excel sheet. Do you want to display the values
connectivity step
connectivity step  sir.pls give me step one by one for connect the java program to oracle.   Follow these steps: 1) Import the following packages in your java file:*** import java.sql.*; import oracle.jdbc.driver.
JDBC CONNECTIVITY
connectivity Other JDBC Tutorials
in connectivity - Hibernate
insertted  Hi friend, This is connectivity and hibernate configuration
DB connectivity - EJB
DB connectivity  DB connectivity
validate select option jquery
validate select option jquery  How to Validate select option in JQuery
validate() and reset() methods
validate() and reset() methods   Describe validate() and reset() methods
validate bank account number
validate bank account number  how to validate bank account number in jsp