
  PROCEDURE [INLINE] nlp$ta_send_data
    (    cl_connection { input, output } : ^nlt$cl_connection;
         data { input, output } : nlt$bm_message_id;
         end_of_message: boolean;
     VAR status: ost$status);

?? PUSH (LISTEXT := ON) ??
?? RIGHT := 110 ??

    VAR
      data_length: integer,
      actual: integer,
      message: nlt$bm_message_id,
      pdu_header: nlt$ta_data_pdu;

    status.normal := TRUE;
    message := data;

{ Validate data.

    nlp$bm_get_message_length (message, data_length);
    IF data_length >= nlc$ta_minimum_data_length THEN

{ Build data pdu.

      pdu_header.length := #SIZE (nlt$ta_data_pdu);
      pdu_header.kind := nlc$ta_data_request;
      pdu_header.end_of_message := end_of_message;

{ Merge data and pdu.

      nlp$bm_add_message_prefix (^pdu_header, pdu_header.length, message);
      nlp$cc_send_data (cl_connection, message, status);

{! statistics begin}
      IF status.normal THEN
        osp$increment_locked_variable (nav$global_osi_statistics.transport_access_agent.data_pdus_sent, 0,
              actual);
        osp$add_to_locked_variable (nav$global_osi_statistics.transport_access_agent.total_bytes_sent, 0,
              data_length + pdu_header.length, actual);
      IFEND;
{! statistics end}

    ELSE
      nlp$bm_release_message (message);
      osp$set_status_condition (nae$ta_data_length_error, status);
      osp$append_status_integer (osc$status_parameter_delimiter, nlc$ta_minimum_data_length, 10, TRUE,
            status);
    IFEND;
  PROCEND nlp$ta_send_data;

*copy nlh$ta_send_data

*copyc nae$osi_internal_interfaces
*copyc nat$data_length
*copyc nlc$ta_data_lengths
*copyc nlt$bm_message_id
*copyc nlt$cl_connection
*copyc nlt$ta_protocol_data_unit
*copyc ost$status
*copyc nlp$bm_add_message_prefix
*copyc nlp$bm_get_message_length
*copyc nlp$bm_release_message
*copyc nlp$cc_send_data
*copyc osp$add_to_locked_variable
*copyc osp$append_status_integer
*copyc osp$increment_locked_variable
*copyc osp$set_status_condition
*copyc nav$global_osi_statistics
?? POP ??
