Dict: Client-Server Transaction Processing

This sample demonstrates use of the implicit_handle, context_handle, in, and out attributes. This sample program is an example of a nontrivial local application converted to a distributed RPC application.

The local program is a character-oriented "play" program, which lets a user insert, delete, and iterate over a dictionary. The dictionary is based on splay trees.

The basic program was remoted by taking the interface to the dictionary (given in dict0.h) and creating an interface to a remote dictionary, (given in replay.idl) which is remoted using RPC. Following the local dictionary interface, which is minimal and uniform, the remote interface is also uniform. However, since the local dictionary is generic (can store any item type, using void* pointers to items), the interface had to be changed to deal with predefined (Record) type items in order to be remoted using the Microsoft RPC system. Also, since the local implementation allows a "peek" at the root of the tree using a DICT_CURR_ITEM macro, the whole interface had to be changed.

Main Files

File Description
Client.c Client main program. This is the driver for the client side remote dictionary (splay trees based) demo.
Play.c Simple interactive loop of calls to the dictionary.
Replay.acf Attribute configuration file
Replay.idl Interface definition language file
Server.c Server main program. This is the driver for the server side remote dictionary, which is based on splay trees.
Makefile Nmake file to build for Windows NT or Windows 95
Makefile.dos Nmake file to build for MS-DOS

Building SDK Samples

This sample uses the following keywords:

allocate_state; clnt_dict_print; comp; defined; dict_curr_item; dict_delete; dict_empty; dict_find; dict_insert; dict_new; dict_new_dict; dict_next; dict_prev; dict_print; dict_vdict_curr_delete; dict_vdict_curr_item; dict_vdict_curr_next; dict_vdict_curr_prev; dict_vdict_delete; dict_vdict_find; dict_vdict_get_dict; dict_vdict_i_dict; dict_vdict_insert; dict_vdict_new; dict_vdict_next; dict_vdict_prev; dict_vdict_x_dict; dictstate_duplicate; exit; free; free_state; freerecord; gets; init_dict; itemcopy; itemduplicate; linprintree; main_dict; makenode; makerecord; malloc; midl_user_allocate; midl_user_free; ndrccontextbinding; ndrclientcontextmarshall; ndrclientcontextunmarshall; ndrclientinitializenew; ndrconvert; ndrfcshort; ndrfreebuffer; ndrgetbuffer; ndrpointerbuffersize; ndrpointerfree; ndrpointermarshall; ndrpointerunmarshall; ndrscontextunmarshall; ndrscontextvalue; ndrsendreceive; ndrservercontextmarshall; ndrservercontextunmarshall; ndrserverinitializenew; ndrsimplestructbuffersize; ndrsimplestructmarshall; ndrsimplestructunmarshall; ndrsimpletypemarshall; ndrsimpletypeunmarshall; print_tree_sat; printf; printrecord; printree; rdict_curr_record; rdict_duplicate; rdict_free_dict; rdict_ref_count; rdict_state; recordtreefree; recordtreenodefree; revprintree; rpcbindingfree; rpcbindingfromstringbinding; rpcexcept; rpcexceptioncode; rpcraiseexception; rpcserverlisten; rpcserverregisterif; rpcserveruseprotseqep; rpcstringbindingcompose; rpcstringfree; splay; sscanf; strcmp; strcpy; tdsplay; tdsplayleft; tdsplayright; testloop; tolower; tree_duplicate; treenode_duplicate; treenode_new; usage; usage_msg; vdict_curr_delete; vdict_curr_item; vdict_curr_next; vdict_curr_prev; vdict_delete; vdict_find; vdict_get_dict; vdict_i_dict; vdict_insert; vdict_new; vdict_next; vdict_prev; vdict_print; vdict_rundown; vdict_x_dict