@@ -0,0 +1,1528 @@
+import java.io.*;  %0Aimport java.net.*;  %0Aimport java.util.*;  %0Aimport java.util.TimerTask;  %0A//import org.apache.commons.*;%0A//import org.apache.commons.net.telnet.TelnetClient;  %0Aclass Connectivity extends TimerTask  %0A%7B  %0A    public static void main(String args%5B%5D)  %0A    %7B  %0A        try  %0A        %7B  %0A            System.out.println(%22Please enter ip address%22);  %0A            Scanner sc=new Scanner(System.in);  %0A            String ip=sc.nextLine().trim();  %0A            System.out.println(%22Please enter port number%22);  %0A            TimerTask con  = new Connectivity();  %0A            Scanner sc1=new Scanner(System.in);  %0A            int port=sc1.nextInt();  %0A            Timer timer = new Timer();  %0A            timer.scheduleAtFixedRate(con,1,1000);  %0A            Socket s1=new Socket(ip,port);  %0A            InputStream is=s1.getInputStream();  %0A            DataInputStream dis=new DataInputStream(is);  %0A            if(dis!=null)  %0A            %7B  %0A                System.out.println(%22Connected with ip %22+ip+%22 and port %22+port);  %0A            %7D  %0A            else  %0A            %7B  %0A                System.out.println(%22Connection invalid%22);  %0A            %7D  %0A              %0A            dis.close();  %0A            s1.close();  %0A              %0A        %7D  %0A        catch(Exception e)  %0A        %7B  %0A            System.out.println(%22Not Connected,Please enter proper input%22);  %0A              %0A        %7D  %0A          %0A    %7D  %0A  %0A    @Override  %0A    public void run() %7B  %0A        // TODO Auto-generated method stub  %0A          %0A    %7D  %0A%7D%0A

Create Connectivity.java