Mico is installed on the FreeBSD machines only (not on the CS machines). The complete set of examples that come with the Mico distribution can be found in /usr/local/doc/mico/examples. Two of these examples are here, these are the two that are discussed in the manual (account and account2). IMPORTANT!!!! Use gmake (not make). Linking is very slow (be patient). --------------------------------------------------------- The Mico Manual is the file manual.ps. Chapter 3 is probably all you will need (unless you want to do something fancy). ---------------------------------------------------------------- Here is a brief description of how you can handle the issue of getting your first obejct reference when using Mico. This is also discussed in the Mico manual. How does the client get an object reference to the server object? There are a number of ways this can happen: 1. Server creates an object reference, converts to string and gets this string to the client via memory or a file. -Check out the "account" directory for an example of code that has the server and client in the same address space (within one process). The server creates and object and converts the object reference to a string, which is then used by the object client. -Check out the first example in section 3.3.3 of the manual for an example that includes seperate client and server processes. The server process creates and object and saves a string representation of the object reference in a file. When the client starts it reads the client reference from the file 2. A naming service is used. This involves running a corba naming service (as a separate process). Corba includes a specification for this service, so any code that uses this is more portable than code relying on using the file system to transfer object references. Mico includes a naming service daemon called "nsd" that implements the Corba Name Service. To use this service you have to: - run the daemon. - have the server register with the Name Service. - have the client query the Name Service, that is, to look up an object reference given a well known name. BUT, we are (almost) right back to the initial question - how do we get an object reference for the Name Service? There is nothing in the Corba spec that details how this will happen, so we have to use Mico-specific code. When using Mico you can use the Mico Binder - which is pretty simple to use, but is not portable. The general idea is that Mico includes a simple naming service that is easy to use, and that provides a mappings to object references from addresses and repository IDs. Mico has it's own syntax for specifying these addresses and IDs - see section 3.3.3 of the manual for the details. Note that you don't need to run the Name Service Daemon nsd, this simple naming service is built in. Look at "account2" in the examples directory for sample code that uses the Mico Binder. Here is an overview of what you need to do: Client: use orb->bind(name,address) to acquire an object reference. The "name" looks like this: "IDL:ObjectName:1.0" where ObjectName is the interface name and 1.0 indicates a version number. The "address" looks like this: "inet:hostname:port" where hostname is the name of the host running the server and port is its' portnumber. Server: enable IIOP on the server by specifying command line option "-ORBIIOPAddr inet:hostname:portnum". Note that in the server the call to ORB_init passes argv,arc in (this is how these options reach the ORB). hostname should be the name of the host you are running the server on and portnum can be any number you want (>1024). So starting the server might look like this: ./server -ORBIIOPAddr inet:monica.cs.rpi.edu:8765 and assuming we are dealing with a Corba interface named "EmailDB" the client call to bind would look like this: CORBA::Object_var obj = orb->bind ("IDL:EmailDB:1.0", "inet:monica.cs.rpi.edu:8765");