anchor.diff:  
   
   
  --
  -;;;; CORBA:Request - deferred operations
  -
  -(define-method send_oneway ((req client-request))
  -  (setf (response-expected req) nil)  
  -  (request-marshal req)
  -  (send-request req))
  -
  -(define-method send_deferred ((req client-request))
  -  (request-marshal req)
  -  (send-request req))
  -
  -
  -(defun request-wait-response (req)
  -  (orb-wait #'request-status req))
  -
  -(defun request-marshal (req)
  -  (let ((buffer (request-marshal-head req)))
  -    (loop for nv in (request-paramlist req)
  -          when (/= 0 (logand ARG_IN (op:arg_modes nv)))
  -          do (marshal-any-value (op:argument nv) buffer))))
  -
  -(defun request-unmarshal-result (req buffer)
  -  (loop for nv in (request-paramlist req)
  -        when (/= 0 (logand ARG_OUT (op:arg_modes nv)))
  -        do (setf (any-value (op:argument nv))
  -                 (unmarshal (any-typecode (op:argument nv)) buffer))))
  -
  -(defun request-unmarshal-userexception (req buffer)
  -  (let* ((id (unmarshal-string buffer))
  -         (tc (request-exception-typecode req id))
  -         (retval (op:return_value req) ))
  -    (if tc
  -      (setf (any-value retval) (unmarshal tc buffer)
  -            (any-typecode retval) tc)
  -      (setf (any-value retval) (system-exception 'corba:unknown 1 :completed_yes)
  -            (any-typecode retval) nil))))
  -
  -(defun request-unmarshal-systemexception (req buffer)
  -  (let ((retval (op:return_value req)))
  -    (setf (any-value retval) (unmarshal-systemexception buffer)
  -          (any-typecode retval) nil)))
  -
  -
  -
  -;;; void get_response () raises (WrongTransaction);
  -
  -;; get_response returns the result of a request. If get_response is
  -;; called before the request has completed, it blocks until the
  -;; request has completed. Upon return, the out parameters and return
  -;; values defined in the Request are set appropriately and they may be
  -;; treated as if the Request invoke operation had been used to perform
  -;; the request.
  -
  -;; A request has an associated transaction context if the thread
  -;; originating the request had a non-null transaction context and the
  -;; target object is a transactional object. The get_response operation
  -;; may raise the WrongTransaction exception if the request has an
  -;; associated transaction context, and the thread invoking
  -;; get_response either has a null transaction context or a non-null
  -;; transaction context that differs from that of the request.
  -
  -(define-method get_response ((req client-request))
  -  (loop 
  -    (request-wait-response req)
  -    (let ((buffer (request-buffer req)))
  -      (unless buffer (return))
  -      (let ((status (request-status req)))
  -        (case status
  -          (:location_forward
  -           (setf (object-forward (request-target req))
  -                 (unmarshal-object buffer))
  -           (request-marshal req)
  -           (send-request req))
  -          (otherwise
  -           (ecase status
  -             (:no_exception 
  -              (request-unmarshal-result req buffer)
  -              (has-received-reply (the-orb req) req))
  -             (:user_exception 
  -              (request-unmarshal-userexception req buffer)
  -              (has-received-exception (the-orb req) req))
  -             (:system_exception
  -              (request-unmarshal-systemexception req buffer)
  -              (has-received-exception (the-orb req) req)))
  -           (setf (request-buffer req) nil)
  -           (return))))))
  -    (values))
  -
  -(define-method poll_response ((req client-request))
  -  ;; FIXME: possibly (orb-wait ...) if without timeout
  -  (not (null (request-status req))))
  -
  -(defun request-exception-typecode (request id)
  -  (find id (request-exceptions request)
  -        :key #'op:id :test #'equal))
  -
  -
  -
   ;;;; Support for static stubs
   
   (defun start-request (operation object &optional no-response)
  
positive.code:               (setf (object-forward (request-target req))
                      (unmarshal-object buffer))
                (values status))
               (:system_exception
                (let ((condition (unmarshal-systemexception buffer)))
                  (setf (request-exception req) condition)
  
negative.code:       (request-locate-repy req status buffer))))
  
  
  (defun comm-failure-handler (conn)
    (let ((requests (connection-client-requests conn)))
      (dolist (req requests)
        (setf (request-exception req) (make-condition 'CORBA:COMM_FAILURE))
        (setf (request-status req) :error )))
    (setf (connection-client-requests conn) nil))
  
  
  