private void readOP(SelectionKey key) {
        try {
            SocketChannel socketChannel = (SocketChannel) key.channel();
            for (ByteBuffer byteBuffer : buffer) {
                if (byteBuffer != null)
                    byteBuffer.clear();
            }
            long numRead;

            numRead = readBuffer(key, 0);

            if (!socketChannel.isOpen()) return;

            if (numRead > 0) {
                ProtocolHeader protocolHeader = null;
                try {
                    byteReceived.inc(numRead);
                    buffer[0].flip();
                    protocolHeader = ProtocolUtils.checkHeaderIntegrity(buffer[0]);
                } catch (Exception e) {
                    log.severe("Check header integrity failed ! cause: " + e.getMessage());
                }


                switch (protocolHeader.getCommandType()) {
                    case Protocol.HEADER_COMMAND_PUBLISH:
                    case Protocol.HEADER_COMMAND_SUBSCRIBE: {
                        if (handleMessage(key, socketChannel, protocolHeader)) return;
                        break;
                    }

                }
            }


        } catch (Exception ex) {
            log.severe("Error read operation, cause: " + ex.getMessage());
            ex.printStackTrace();
        }


    }