Validate telnet connectivity

Validate telnet connectivity

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

    }
}

Ads









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
ModuleNotFoundError: No module named 'dubbo_telnet'
ModuleNotFoundError: No module named 'dubbo_telnet'  Hi, My Python... 'dubbo_telnet' How to remove the ModuleNotFoundError: No module named 'dubbo_telnet' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'dubbo_telnet'
ModuleNotFoundError: No module named 'dubbo_telnet'  Hi, My Python... 'dubbo_telnet' How to remove the ModuleNotFoundError: No module named 'dubbo_telnet' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'telnet_device'
ModuleNotFoundError: No module named 'telnet_device'  Hi, My... 'telnet_device' How to remove the ModuleNotFoundError: No module named 'telnet_device' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'python-telnet-vlc'
ModuleNotFoundError: No module named 'python-telnet-vlc'  Hi, My... named 'python-telnet-vlc' How to remove the ModuleNotFoundError: No module named 'python-telnet-vlc' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'python-telnet-vlc'
ModuleNotFoundError: No module named 'python-telnet-vlc'  Hi, My... named 'python-telnet-vlc' How to remove the ModuleNotFoundError: No module named 'python-telnet-vlc' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'python-telnet-vlc'
ModuleNotFoundError: No module named 'python-telnet-vlc'  Hi, My... named 'python-telnet-vlc' How to remove the ModuleNotFoundError: No module named 'python-telnet-vlc' error? Thanks   Hi, In your
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
database connectivity
database connectivity  how to create database connectivity between HTML and sql server2005
Java connectivity with MySQL
Java connectivity with MySQL  Java connectivity with MySQL
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
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 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
connectivity
connectivity
connectivity
JDBC CONNECTIVITY
connectivity Other JDBC Tutorials
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.
validate select option jquery
validate select option jquery  How to Validate select option in JQuery
VALIDATE
ModuleNotFoundError: No module named 'connectivity'
ModuleNotFoundError: No module named 'connectivity'  Hi, My Python... 'connectivity' How to remove the ModuleNotFoundError: No module named 'connectivity' error? Thanks   Hi, In your python
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
ModuleNotFoundError: No module named 'validate'
ModuleNotFoundError: No module named 'validate'  Hi, My Python... 'validate' How to remove the ModuleNotFoundError: No module named 'validate... to install padas library. You can install validate python with following
ModuleNotFoundError: No module named 'validate-it'
ModuleNotFoundError: No module named 'validate-it'  Hi, My Python... 'validate-it' How to remove the ModuleNotFoundError: No module named 'validate-it' error? Thanks   Hi, In your python environment
sql connectivity through java
sql connectivity through java  i want an example for java db through sql connection. Thanks in advance
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
jdbc connectivity to mysql tutorial
jdbc connectivity to mysql tutorial  here is complete jdbc connectivity to mysql tutorial for newbies. Person who don't even know how to install mysql and don't know about which driver to use can do with ease
Database connectivity Hibernate mysql connection.
Database connectivity Hibernate mysql connection.  How to do database connectivity in Hibernate using mysql
validate input php
validate input php  How to validate the input fields in PHP & HTML.   Hi, Please let's know many fields is to be validated. Then I will make an example for you. Thanks
oracle connectivity problem with netbeans
oracle connectivity problem with netbeans  sir I am using oracle.... for this after adding new driver(ojdbc6.jar) in services tab I got connectivity with oracle... of simple connectivity with oracle in this I am giving driver details
j2me mysql connectivity
j2me mysql connectivity  I do a project on reservation using j2me. I need a connectivity to a MYSQL database. How do I do this Thanks and regards Karthiga
database connectivity problem
database connectivity problem  what if client dont have database with them then what is other way to run successfully our programm   Please visit the following link: http://www.roseindia.net/jdbc
Database Connectivity Withe Oracle
Database Connectivity Withe Oracle  Develop a program to perform the database driven operation like insert, Delete, Update and select. To perform the above operations create one table named Employee. Field Name Field Type EmpId
jdbc oracle connectivity problem
jdbc oracle connectivity problem  Hi All, I am trying to connect my swing application to oracle DB . but class.forname is giving error. Please suggest me if there is some different way to connect swing application to oracle

Ads