File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes Plz help to solve it. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Plz help to solve it." Watch "Plz help to solve it." New topic

Plz help to solve it.

Nasir Mkhan

Joined: May 13, 2001
Posts: 28
Hello all,
I am trying to test this client-server socket communication on stand-alone pc,client program successfully connects to server but empty stream found on client.Plz tell me what is the problem?
Client Program:
InetAddress adress=InetAddress.getLocalHost();
Socket client=new Socket(address,80);
InputStream in=client.getInputStream();
InputStreamReader in2=new InputStreamReader(in);
Server Program:
ServerSocket server=new ServerSocket(80);
Socket connection=server.accept();
System.out.println("Client is connected");
OutputStreamWriter out=new OutputStreamWriter (connection.getOutputStream());
Thanks in any way.
I agree. Here's the link:
subject: Plz help to solve it.
It's not a secret anymore!