title: Java Socket - Broken pipe error
body: <p>I am trying to send <strong>int</strong> value, <strong>long</strong> value, <strong>long</strong> array and <strong>2d double</strong> array via socket from the Client to the Server.</p>
  
  <p>I successfully sent int, long values and long array, however when it comes to the double array (output.writeObject(server_ind); - see Client Side code below), I am getting the following error:</p>
  
  <p><strong>ERROR:</strong></p>
  
  <pre><code>java.net.SocketException: Broken pipe
      at java.net.SocketOutputStream.socketWrite0(Native Method)
      at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
      at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
      at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1876)
      at java.io.ObjectOutputStream$BlockDataOutputStream.writeByte(ObjectOutputStream.java:1914)
      at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1575)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:350)
      at clientSide.ClientSocket.connectionProtocol(ClientSocket.java:36)
      at clientSide.clientMain.main(clientMain.java:97)
  </code></pre>
  
  <p>My code is the following:</p>
  
  <p><strong>Client Side:</strong></p>
  
  <pre><code>        ObjectOutputStream output = new ObjectOutputStream(socket.getOutputStream());
  
          output.writeObject(num_doc); //int value
          output.flush();
  
          output.writeObject(num); //long value
          output.flush();
  
          output.writeObject(queryTDs); //long[] array
          output.flush();
  
          output.writeObject(server_ind); //double[][]
          output.flush();
  </code></pre>
  
  <p><strong>Server Side:</strong></p>
  
  <pre><code>    input = new ObjectInputStream(clientSocket.getInputStream());
  
      num_doc = input.readInt();
      num = input.readLong();
      TDs = (long[]) input.readObject();
      server_ind = (double[][]) input.readObject();
  
      output = new ObjectOutputStream(clientSocket.getOutputStream());
      output.writeObject("Received");
  </code></pre>
  
  <p>Thanks!</p>