code: protected Serializable executeCommand(String command, Serializable[] arguments) throws Throwable
     {
        Socket socket = null;
        try
        {
           socket = new Socket(host, port);
  
           ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
           
           oos.writeUTF(command);
           
           if (arguments != null)
           {
              oos.writeInt(arguments.length);
              for (Serializable argument : arguments)
              {
                 oos.writeObject(argument);
              }
           }
           else
           {
              oos.writeInt(0);
           }
           
           oos.flush();
  
           ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
           
           return (Serializable)ois.readObject();
        }
        catch (EOFException ee)
        {
           // Nothing
        }
        finally
        {
           try
           {
              if (socket != null)
                 socket.close();
           }
           catch (IOException ignore)
           {
              // Ignore
           }
        }
  
        return null;
     }
docs: Execute command
  @param command The command
  @param arguments The arguments
  @return The result
  @exception Throwable If an error occurs