• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

server/client program

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i pretty much re-typed the code from the oracle tutorial for sockets, but somehow it's not working.

i ran with

java Server 7
java Client localhost 7

with two consoles open.
i entered an input string for the Client console, but i'm not getting any echoes back.

i've checked and rechecked but i can't find what's missing.

Client.java


Server.java


the original codes are below:
http://docs.oracle.com/javase/tutorial/networking/sockets/examples/EchoClient.java
http://docs.oracle.com/javase/tutorial/networking/sockets/examples/EchoServer.java
 
Marshal
Posts: 28226
95
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
I would suggest starting with an exact copy of the tutorial classes, and see if they work.

And anyway if you changed something in those tutorial classes, that's probably what broke them. You would be in a much better place to tell what you changed than we would.
 
What's brown and sticky? ... a stick. Or a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic