private static NetworkInteraction sendReceive(NetworkInteraction interaction) throws IOException {
        TaskTree tree=null;
        Socket socket=null;
        ObjectInputStream in = null;
        ObjectOutputStream out = null;
        NetworkInteraction readInteraction=null;
        try {
            SERVER_ADDRESS=InetAddress.getLocalHost();
            socket = new Socket(SERVER_ADDRESS, SERVER_PORT);
            out = new ObjectOutputStream(socket.getOutputStream());
            out.writeObject(interaction);
            out.flush();
            in = new ObjectInputStream(socket.getInputStream());
            readInteraction = (NetworkInteraction) in.readObject();
        }  catch (ClassNotFoundException e) {
            e.printStackTrace();
        } finally {
            try {
                if (socket!=null) socket.close();
                if (in!=null) in.close();
                if (out!=null) out.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return readInteraction;
    }