client test Java source code
#1

Code:
import java.io.*;
import java.net.*;

public class clienttest
{
    public static void main(String a[])
    {
        String wel,res,cr;
        Client client;
        BufferedReader reader,read;
        PrintWriter writer,write;

        client = new Client("localhost",8001);
        reader = new BufferedReader(new InputStreamReader(client.in));
        writer = new PrintWriter(new OutputStreamWriter(client.out),true);
        read = new BufferedReader(new InputStreamReader(System.in));
        write = new PrintWriter(new OutputStreamWriter(System.out),true);
        while(true) {
            try {
                wel = reader.readLine();
                System.out.println("Server Says : '"+wel+"'");
                cr = read.readLine();
                writer.println(cr);
                //res = reader.readLine();
                //System.out.println("Server Responds : '"+res+"'");
                //System.out.println("quit");
                //writer.println("quit");
            }catch(IOException e){
                System.out.println("Client main +"+e);
            }
            try{
                Thread.sleep(10000);
            }catch(Exception i){}
        }
    }
}

class Client{
    public InputStream in;
    public OutputStream out;

    private Socket client;

    public Client(String host,int port)
    {
        try{
            client = new Socket(host,port);
            System.out.println("Client socket : "+client);
            in = client.getInputStream();
            out = client.getOutputStream();
        }catch(IOException e){
            System.out.println("IOE : "+e);
        }
    }
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: java interview test papers, java test app, wel com sayari, wel come sarry, wel come sayari, client test java source code, udp client code java,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Messages In This Thread
client test Java source code - by smart paper boy - 30-08-2011, 12:07 PM

Possibly Related Threads...
Thread Author Replies Views Last Post
  projects in core java project topics 6 16,152 16-01-2018, 11:15 AM
Last Post: dhanabhagya
  Steganography implemented in Java science projects buddy 14 12,214 24-05-2016, 10:15 AM
Last Post: dhanabhagya
  STUDENT INFORMATION SYSTEM IN JAVA project topics 14 10,648 19-08-2015, 11:28 PM
Last Post: Guest
  mini projects in java project topics 7 18,806 01-05-2015, 04:18 PM
Last Post: seminar report asees
  CLIENT SERVER BASED LIVE MEETING computer girl 4 4,468 25-07-2014, 10:37 PM
Last Post: seminar report asees
  Visa Processing System full report and asp source code project topics 2 5,557 19-06-2014, 06:54 PM
Last Post: seminar report asees
  distributed cache updating for the dynamic source routing protocol project report tiger 4 3,000 05-03-2013, 02:22 PM
Last Post: Guest
  DESIGN OF AN INTRANET MAIL CLIENT SYSTEM Electrical Fan 1 3,094 06-12-2012, 01:35 PM
Last Post: seminar details
  application projects in java and vb.net (titles and topics) project topics 1 5,504 28-11-2012, 01:11 PM
Last Post: seminar details
  Energy-Efficient Routing in Mobile Ad Hoc Networks: Mobility-Assisted Case (Java) project topics 1 1,766 12-11-2012, 12:42 PM
Last Post: seminar details

Forum Jump: