Posted on 2002-05-30
I'm seeing a slightly weird error in a client/server program I'm working on. I have a class I wrote with a send and receive method in it. These appear to work quite well except for every once in a while I get an EOFException on my readInt() call to inputStream (which is a DataInputStream created from a socket). I have no idea how to reproduce this regularly, and can't figure out what might be wrong with this. Please take a look at my send and receive methods to see if I'm missing something. Thanks.
public void send(byte buffer) throws SocketException, IOException
int size = buffer.length;
public byte receive() throws SocketException, IOException
int size = inputStream.readInt();
byte buffer = new byte[size];