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 Chriss Miller 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
Joined
Oct 12, 2011
Messages
1
Location
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