1 vs 1 TCP/IP Game, how many ports needed?

I was doing well using one connection (one port) having a ClientServer.class i created for the purpose. I send strings between the client and server and game worked prefectly.

However, I recently discovered that when loading saves I must send objects and I started using ObjectOutputStream and ObjectInputStream for that sole reason. This only seemed to work one way!

Having
ObjectOutputStream
ObjectInputStream

on both client and server seemed to make that none of them could readObject from it. Basically, is the problem i use the same socket for sending and receiving?

Instead if I had OOS on the server side and OIS on client side it worked, not when I had OOS and OIS on both.

It worked well with DataOutputStream using the same socket for incoming and outgoing traffic. I need to create 2 connections? What am I doing wrong?

Examining it further, things get abit clear but bizarre:

oiStream = new ObjectInputStream(new BufferedInputStream(serverSock.getInputStream()));

FAILS

ooStream = new ObjectOutputStream(new BufferedOutputStream(serverSock.getOutputStream()));

WORKS

How come the ObjectOutputStream works and not the ObjectInputStream?

Is this the odd thing that ObjectInputStream waits for some header information from the other end of the connection before returning?

Here are some details: http://forum.java.sun.com/thread.jspa?threadID=627211&tstart=30

Kev

How does it fail? Does it fail to compile? Does it throw an exception? or are you just not getting what you expect?

If the latter, are you flushing the output stream before tryign to read it from the inoput stream?