A problem with java Object Streams via sockets
<p>Hi
I want to send an array of double as an object via ObjectOutputStream that uses a socket for outputStream. In the receiving side I read repetitious objects all the same! Maybe the assignment of method readObject doesn't perform it's task. 
I'm trying to update dobArray and write it to the socket output stream. dobArray is updated by another thread. It does it's task well, because I tested it. here is my code:</p>

<p>sending side:</p>

<pre><code>    objectStream = new ObjectOutputStream(dataFlow.getOutputStream());

    while(busy){
        try {
            // dobArray is updated in another thread
            objectStream.writeObject( dobArray);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
</code></pre>

<p>receiving side:</p>

<pre><code>    objectInputStream = new ObjectInputStream(
            mainServer.dataFlow.getInputStream());
    while (busy){
        try {
            DobArray dobarray =
                (DobArray) objectInputStream.readObject()
            writeToFile(dobarray);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
</code></pre>

<p>regards 
sajad</p>
