File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
It's not a secret anymore!