Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getOutputStream() before getInputStream()

Status
Not open for further replies.

hildegarbage

Programmer
Oct 12, 2011
1
0
0
SE
I have a simple Client-server program and I couldnt get the communication to work until I found that I had tried to create the inputstream before the outputstream. Why does this not work?

ObjectInputStream in = new ObjectInputStream(
serverSocket.getInputStream());

ObjectOutputStream out = new ObjectOutputStream(
serverSocket.getOutputStream());

(This order does not work.)
 
Difficult to know without the server code, but I guess you have a case like the one described here

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top