File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

socket prog not working

 
anurag jha
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guys am trying to create a simple server and client program, but the program is not working.
Can you all help me out.

****ChatServer class****


****ChatClient class****


 
Paul Clapham
Sheriff
Pie
Posts: 20171
24
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Anurag Jha, welcome to the Ranch!

I edited your post to put your code into the "Code" tags to make it readable (have a look, I'm sure you will agree that it's much better that way). Could you do that yourself in future?

As for your question... what is it? Please read our FAQ articles ItDoesntWorkIsUseless and TellTheDetails for helpful information on how to make your posts better.
 
anurag jha
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks paul, your help in much appreciated and sorry for the trouble.

when i run the program, and enter String at server console ; the String is not printed in the client console.
When i tried debugging the program, i found that the control is not going beyond line 28 in ChatClient class.

but if i comment out :
lines 44 - 47 and line 50 in ChatServer class
lines 31 - 36 and line 39 in ChatClient class , then i can successfully transmit Strings from server to client.

Why is one-way communication working but two-way communication not working ?



  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic