# TAO ORB Internals

This document will describe how the ORB internals work, with special attention to the areas that are more poorly documented. For example: we will not document (at least initially) the pluggable protocols framework, the interpretive marshaling engine, the POA, the waiting strategies and the leader-follower.

New ORB developers are expected to read this document and document here all the things that they find hard to understand, surprising or event broken. New members of the ORB core team are expected to fill in details that were not explained before.

### Client Side event sequence

In this section we will document the sequence of calls and interactions on the client side. Only the synchronous case, without forwarding or exceptions is documented at this point.

Assume the application invokes a method on an object reference, in the generated stub for that method the following sequence is started:

- creates TAO_GIOP_Twoway_Invocation object
- calls start method on the invocation object
- TAO_GIOP_Twoway_Invocation::start:
  - finds the profile to use for this invocation
  - passes the profile to Connector Registry to obtain TAO_Transport object (wrapper around Service_Handler)
  - generates and marshalls GIOP & Request headers for this invocation
- marshalls request parameters
- calls invoke method on the invocation object
- TAO_GIOP_Twoway_Invocation::invoke:
  - sets TAO_Reply_Dispatcher (this is used to make both synch and asynch requests look the same)
  - sends the request
  - waits on the TAO_Wait_Strategy
- if there was a minor problem or location forward, tries again: call TAO_GIO_Twoway_Invocation::start, etc.
- if everything went ok, demarshalls reply