code: public ProtocolDataUnit receiveFromWire () throws DigestException , InternetSCSIException , IOException {
  
          final ProtocolDataUnit protocolDataUnit = protocolDataUnitFactory.create(connection.getSetting(OperationalTextKey.HEADER_DIGEST), connection.getSetting(OperationalTextKey.DATA_DIGEST));
  
          try {
              protocolDataUnit.read(socketChannel);
          } catch (ClosedChannelException e) {
              throw new InternetSCSIException(e);
          }
  
          LOGGER.debug("Receiving this PDU: " + protocolDataUnit);
  
          final Exception isCorrect = connection.getState().isCorrect(protocolDataUnit);
          if (isCorrect == null) {
              LOGGER.trace("Adding PDU to Receiving Queue.");
  
              final TargetMessageParser parser = (TargetMessageParser) protocolDataUnit.getBasicHeaderSegment().getParser();
              final Session session = connection.getSession();
  
              // the PDU maxCmdSN is greater than the local maxCmdSN, so we
              // have to update the local one
              if (session.getMaximumCommandSequenceNumber().compareTo(parser.getMaximumCommandSequenceNumber()) < 0) {
                  session.setMaximumCommandSequenceNumber(parser.getMaximumCommandSequenceNumber());
              }
  
              // the PDU expCmdSN is greater than the local expCmdSN, so we
              // have to update the local one
              if (parser.incrementSequenceNumber()) {
                  if (connection.getExpectedStatusSequenceNumber().compareTo(parser.getStatusSequenceNumber()) >= 0) {
                      connection.incrementExpectedStatusSequenceNumber();
                  } else {
                      LOGGER.error("Status Sequence Number Mismatch (received, expected): " + parser.getStatusSequenceNumber() + ", " + (connection.getExpectedStatusSequenceNumber().getValue() - 1));
                  }
  
              }
  
          } else {
              throw new InternetSCSIException(isCorrect);
          }
          return protocolDataUnit;
      }
docs: Receives a <code>ProtocolDataUnit</code> from the socket and appends it to the end of the receiving queue of this
  connection.
  
  @return Queue with the resulting units
  @throws IOException if an I/O error occurs.
  @throws InternetSCSIException if any violation of the iSCSI-Standard emerge.
  @throws DigestException if a mismatch of the digest exists.