New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Java Projects


Posted Date:     Total Responses: 0    Posted By: vivek   Member Level: Gold   Points/Cash: 3   


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);
}
}
}


Project Feedbacks


No feedbacks found. Be the first to respond and make money from revenue sharing program.

Post Feedback
You must Sign In to post a feedback.
Next Project: ChoiceDemo Java Projects
Previous Project: ColorDemo

Return to Project Index

Post New Project


Related Projects






Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

AdSense Revenue Sharing sites

ISC Technologies.
2006 - 2009 All Rights Reserved.