Command tmpCommand; while (!stop) { try { tmpCommand = (Command)objectInputStream.readObject(); System.out.println("received " + tmpCommand); downlinkOwner.processMsg(tmpCommand); try { this.sleep(this.LISTEN_DELAY); } catch (java.lang.InterruptedException e) { System.out.println(e); } } catch (java.io.IOException e) { System.out.println(e); this.stopDownlink(); } catch (java.lang.ClassNotFoundException e) { System.out.println(e); }
Command tmpCommand;  while (!stop) { try { tmpCommand = (Command) objectInputStream.readObject();  Debug.println("Downlink: received " + tmpCommand); downlinkOwner.processMsg(tmpCommand);  try { sleep(Downlink.LISTEN_DELAY); } catch (java.lang.InterruptedException e) { Debug.println(Debug.HIGH, e);
    private void listen() {        //  String tmpString;        Command tmpCommand;        while (!stop) {            try {                tmpCommand = (Command)objectInputStream.readObject();                System.out.println("received " + tmpCommand);                downlinkOwner.processMsg(tmpCommand);                try {                    this.sleep(this.LISTEN_DELAY);                }                catch (java.lang.InterruptedException e) {                    System.out.println(e);                }            } catch (java.io.IOException e) {                System.out.println(e);                this.stopDownlink();            }            catch (java.lang.ClassNotFoundException e) {                System.out.println(e);            }        }        try {            this.objectInputStream.close();        }        catch (java.io.IOException e) {            System.out.println(e);        }        System.out.println("downlink stopped");    }