I'm making a server that's waits for my UserPicture object to come in from a client. When I send one object it works fine. But I get Errorjava.io.StreamCorruptedException: invalid stream header: 7371007E when I try to send another object from the client.
Here's how I'm waiting for the server to receive the object in a thread:
while(true)
{
System.out.println("still waiting for image!");
ois = new ObjectInputStream(s.getInputStream());
System.out.println("got the image");
UserPicture usePic = (UserPicture)ois.readObject();
//do some other work with usePic
}
any ideas why i'm getting this issue?