public void run() {

        try {
            while(s.isConnected() && out != null) {

                try {
                    Thread.sleep(400);
                } catch (InterruptedException e) {}

                out.flush();
                out.reset();

                System.out.println("Sent an update!");
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (out != null)
                    out.close();
                if (!s.isClosed())
                    s.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        
    }