Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem from a networking newbie

 
Sven Thor
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have problems when I try to run this simple textbook-like example.
The server starts ok. Writing data from the client to the server is ok. The server receives string and is supposed to write a string back to the stream connected to the client. However, the client hangs when it tries to read the result from the stream. I do not see why ?

I would think this would work without multithreading the server or using callbacks.

br,
Sven

 
Joe Ess
Bartender
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are reading until the end-of-stream:


But you aren't terminating the output stream on the client or the server. You can do that by invoking close() on the output stream or shutdownOutput() on the socket.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic