Code example for Socket

Methods: close, shutdownInput, shutdownOutput

0
        } 
 
        public void requestStop() { 
            try { 
                this.stop = true;
                this.sock.shutdownInput();
                this.sock.shutdownOutput();
                this.sock.close();
                this.in.close();
                this.out.close();
            } catch (IOException e) {
                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            } 
        } 
 
        protected void registerData(String name) {
            try { 
                if (name != null && name.length() > 0) {
                    JSONObject json = new JSONObject();
                    json.put("action", "register_data");
                    json.put("name", name);