This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Sockets and Internet Protocols and the fly likes Reading and writing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Reading and writing" Watch "Reading and writing" New topic

Reading and writing

Paul Keohan
Ranch Hand

Joined: Mar 15, 2000
Posts: 411
I am new to using sockets but I have a simple server socket running and a client socket which reads what the servers writes (using the writeUTF() method of DataOutputStream). This works fine but I've been trying to get it to work the other way at the same time - where the client writes a message to the server and I can display it on the server side. Basically I have input and output objects in both the server and the client socket objects. I'm getting exceptions when I try all of this so my question is; is this possible at all and if it is, how do I go about doing it?
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
What exceptions? (A stack trace and the relevant exerpt from your code would be lovely).
- Peter
I agree. Here's the link:
subject: Reading and writing