Programming Paradigm
These steps illustrate the programming paradigm for Rendezvous virtual circuits.
Procedure
| 1. | Program code in process A sends a series of application-level messages to process B requesting a virtual circuit. |
| 2. | Program code in process B responds to one of those requests by creating a virtual circuit transport accept object. Creating the accept object also produces a connect subject—an inbox where the accept object listens for protocol messages. |
| 3. | Program code in B sends an application-level reply message to A, inviting A to connect to the accept object. The reply subject of the invitation message is the connect subject of the accept object. |
| 4. | Program code in process A creates a virtual circuit transport connect object—supplying the connect subject from the invitation as an argument to the create call. |
| 5. | The connect object in A automatically initiates a protocol to establish the virtual circuit connection between the two terminal objects. |
| 6. | When the connection is complete (that is, ready to use) both terminals present VC.CONNECTED advisories. From this time forward, either process can send messages on the virtual circuit. |
B must send the connect subject as the reply subject of the invitation message—not as an application-level field of the message. This detail is especially important when routing hardware or software intervenes between the two processes.
Notice that programs must send the request and invitation messages on transports that are already operational. They cannot send them on the virtual circuit transport, because the circuit is not yet complete.
Programs may create listener objects on virtual circuit transports at any time after the create call returns.
Attempting to send messages before the connection is complete produces error status.