def await_release
      segments = receive_single_transmission
      info = segments.first
      if info[:pdu] != PDU_RELEASE_REQUEST
        # For some reason we didn't get our expected release request. Determine why:
        if info[:valid]
          logger.error("Unexpected message type received (PDU: #{info[:pdu]}). Expected a release request. Closing the connection.")
          handle_abort(false)
        else
          logger.error("Timed out while waiting for a release request. Closing the connection.")
        end
        stop_session
      else
        # Properly release the association:
        handle_release
      end
    end
def await_release
      segments = receive_single_transmission
      info = segments.first
      if info[:pdu] != PDU_RELEASE_REQUEST
        # For some reason we didn't get our expected release request. Determine why:
        if info[:valid]
          logger.error("Unexpected message type received (PDU: #{info[:pdu]}). Expected a release request. Closing the connection.")
          handle_abort(false)
        else
          logger.error("Timed out while waiting for a release request. Closing the connection.")
        end
        stop_session
      else
        # Properly release the association:
        handle_release
      end
    end
Creates a Link instance, which is used by both DClient and DServer to handle network communication.

 === Parameters

 * <tt>options</tt> -- A hash of parameters.

 === Options

 * <tt>:ae</tt> -- String. The name of the client (application entity).
 * <tt>:file_handler</tt> -- A customized FileHandler class to use instead of the default FileHandler.
 * <tt>:host_ae</tt> -- String. The name of the server (application entity).
 * <tt>:max_package_size</tt> -- Integer. The maximum allowed size of network packages (in bytes).
 * <tt>:timeout</tt> -- Integer. The maximum period to wait for an answer before aborting the communication.

 Waits for an SCU to issue a release request, and answers it by launching the handle_release method.
 If invalid or no message is received, the connection is closed.