public boolean close() {
        boolean ret = false;
        try {
            if(clientSocket != null) {
                clientSocket.shutdownInput();
                clientSocket.shutdownOutput();
                System.out.println("Client Socket Close");
                if(out != null) {
                    out.close();
                }
            }
            opened = false;
            ret = true;
            GlobalEventHandler.fireEvent(new GlobalEvent(GlobalEventTypes.CLIENT_DISCONNECTED, null));
        } catch (IOException ex) {
            Logger.getLogger(TCPClient.class.getName()).log(Level.SEVERE, null, ex);
            ret = false;
        }
        return ret;
    }