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

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
 
Sheriff
Posts: 28329
97
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.
 
Get meta with me! What pursues us is our own obsessions! But not this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic