Home

GEONius.com
5-Jul-2007
E-mail

coli_util - CORBA-Lite Utilities

CORBA-Lite is a lightweight CORBA implementation consisting of:

COMX_UTIL
marshaling functions for the basic Common Data Representation (CDR) primitive and constructed data types.
GIMX_UTIL
marshalling functions for some of the GIOP data types.
IIOP_UTIL
networking functions for sending and receiving GIOP messages over IIOP (TCP/IP) streams.
COLI_UTIL
higher-level functions for performing CORBA message transactions.

More detailed information about the other packages is found in the respective package prologs. The GIMX_UTIL page has links to the Python scripts used to automatically generate C header and source files from IDL files.

CORBA-Lite does not support the CORBA C binding. It provides a simple, low-level means of communicating with CORBA peers and is useful for writing test/debug clients and servers.

The CORBA-Lite package has been built and tested under Linux, Solaris, Windows (Visual C++ 6.0), VAX/VMS (!), and PalmOS (!). The screen snap to the right is of a standard I/O client running in the PalmOS Emulator (POSE) emulating an M105 Palm Pilot (PalmOS 3.5). The client has requested and is receiving telemetry data from a UNIX server via CORBA callbacks. The first two full lines of output (folded on the screen) are:

    timestamp             flags                 mnemonic = value (EU value)
    2005-307-23:06:51.186 00800000 0000003F R-  CPU_DWELL = 0 [NORMAL_CPU1]
    2005-307-23:06:51.616 00480000 00200002 RL- T02264 = 6.0000000e00 (-2.3974884e00)

which show that the Palm application is receiving and displaying the data correctly, including UNIX timevals, UTF-16 wide-character strings, and IEEE floating-point numbers. (My Palm applications are built using prc-tools. Early in 2006, the project-specific IDL grew so large that one of the code sections overflowed and clients such as the one above no longer build. Base CORBA clients such as colior still build successfully.)

COLI Functions

Once an IIOP connection is established, a client application can use the following two functions for basic communications with the service:

coliRequest()
submits a request for an operation on a service-hosted object. A list of marshaling function/value pairs is supplied for arguments expected by the operation.
coliGetReply()
reads a reply from the service. If the operation was successful, a list of marshaling function/value pairs is used to decode and store the return values and function result returned by the operation.

A server application, on the other hand, would use these functions:

coliGetRequest()
reads a request. If the target object and operation in the request match the caller-supplied object and operation, a list of marshaling function/value pairs is used to decode and store the arguments expected by the operation.
coliReply()
returns the completion status for a request. A list of marshaling function/value pairs is supplied for the return values expected from the operation.

The COLI package also includes routines for working with Interoperable Object References (IORs). Functions are available for constructing IORs, converting between binary and "stringified" IORs, and converting between IORs and corbaloc: URLs.

Finally, two table-lookup functions can be used (with the appropriate tables) to map enumerated types to their ASCII names and vice-versa. These capabilities are useful for displaying enumeration fields in human-readable form and, particularly in the case of application- or project-specific enumerations, for translating human input of field values by name into their binary enumeration values.


Public Procedures

coliGetReply() - gets the next reply from a CORBA server.
coliGetRequest() - gets the next request from a CORBA client.
coliMakeIOR() - make an IOR for an object.
coliO2S() - converts an IOR to a stringified reference.
coliO2URL() - converts an IOR to a URL.
coliProfile() - returns an IOR's TAG_INTERNET_IOP profile.
coliReply() - issues a reply to a prior CORBA request.
coliRequest() - issues a request to a CORBA server object.
coliS2O() - converts a stringified reference to an IOR.
coliToName() - maps a number (e.g., CORBA enumeration) to a name.
coliToNumber() - maps a name to a number (e.g., CORBA enumeration).
coliURL2O() - converts a URL to an IOR.
coliVersion() - gets/sets the GIOP version.

Source Files

coli_util.c
coli_util.h

Alex Measday  /  E-mail