![]() |
|
Use this task to create code for a CORBA client, to shut down the client and release the resources that it used.
This task is one step of the parent task to create the CORBA client main code, as described in Creating a CORBA client main code (client.cpp).
To create code to shut down a CORBA client, edit the client source file, client.cpp to complete the following steps
// This function deallocates resources used throughout the program. void release_resources( ::CORBA::BOA_ptr bp, ::CORBA::ORB_ptr op ) { // Deallocate the various resources we have allocated. ::CORBA::release( bp ); ::CORBA::release( op ); }
This method is called at the end of the client's main method after the client has finished accessing the servant object. (You add a call to this method in the next step.) The method takes as input pointers to the BOA and the ORB. It releases the resources used by the client.
// Deallocate all resources. release_resources( bp, op ); cout << endl << "Client COMPLETED" << endl; cout.flush(); exit( 0 ); }
This task adds code that shuts down a CORBA client and releases the resources that it used.
![]() |