• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

socket prog not working

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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****


 
Sheriff
Posts: 28394
100
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?



 
reply
    Bookmark Topic Watch Topic
  • New Topic