Home Answers Viewqa Java-Beginners Validate telnet connectivity

 
 


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

How to validate telnet connectivity in my java code

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 Pages:
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
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
database connectivity
database connectivity  describe java program steps in order to get connectivity to database along with example
database connectivity
database connectivity  how to create database connectivity between HTML and sql server2005
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
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
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
JDBC CONNECTIVITY
file in environment variable.   Java Mysql connectivity Other JDBC
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
in connectivity - Hibernate
insertted  Hi friend, This is connectivity and hibernate configuration
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
DB connectivity - EJB
DB connectivity  DB connectivity
validate() and reset() methods
validate() and reset() methods   Describe validate() and reset() methods
validate select option jquery
validate select option jquery  How to Validate select option in JQuery
reset() and Validate() method
reset() and Validate() method   How does reset() and Validate() method struts work
validate() method of ActionForm work
validate() method of ActionForm work  How does validate() method of ActionForm work
validate parameter before using it
validate parameter before using it   How to validate the parameter before using it in JSP
validate bank account number
validate bank account number  how to validate bank account number in jsp
validate bank account number
validate bank account number  how to validate bank account number in jsp
validate text field iPhone
validate text field iPhone  i got two different UITextfield in my iPhone application for user login. Just wondering how to validate
use of ActionMapping in validate()
use of ActionMapping in validate()  why do we pass actionmapping in validate(ActionMapping mapping,HttpServletRequest) even we don't use actionmapping in that method
Validate <select> tag Items
Validate select tag Items  Hi, How to validate addition of two numbers of two different "select" tag items in JavaScript..? Thanks in advance
Validate <select> tag Items
Validate select tag Items  Hi, How to validate addition of two numbers of two different "select" tag items in JavaScript..? Thanks in advance

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.