Interface Definition Language (IDL) is used to configure communication between clients and servers in remote procedure calls (RPC). There have been many changes like Sun RPC, ONC RPC, DCE RPC, etc.
Basically, you use the IDL to specify the interface between the client and the server, so that the RPC mechanism can create the code stubs needed to call functions over the network.
RPC needs to create stub functions for the client and server using IDL information. It is very similar to a function prototype in C, but the end result is slightly different, for example:
+----------------+ | Client | | +----------+ | +---------------+ | | main | | | Server | | |----------| | | +----------+ | | | stub_cli |------->| stub_svr | | | +----------+ | | |----------| | +----------------+ | | function | | | +----------+ | +---------------+
In this example, instead of calling function in the same program, main calls the client stub function (with the same prototype as function ), which is responsible for packing the information and transferring it over the wire to another process. It can be the same machine or another machine, it does not really matter - one of the advantages of RPC is the ability to move servers as you wish.
There is a โlistenerโ process on the server that will receive this information and transfer it to the server. A server stub receives information, unpacks it, and passes it to a real function.
The real function then performs what it needs and returns it to the server stub, which can pack the returned information (both the return code and any [out] or [in,out] variables) and transfer it back to the client stub.
Then the client stub unpacks and returns it back to main .
Actuals may vary slightly, but this explanation should be good enough for a conceptual review.
The actual IDL might look like this:
[uuid(f9f6be21-fd32-5577-8f2d-0800132bd567), version(0), endpoint("ncadg_ip_udp:[1234]", "dds:[19]")] interface function_iface { [idempotent] void function( [in] int handle, [out] int *status ); }
Everything at the very top is basically network information, the meat of which is inside the interface section where the prototypes are shown. This allows the IDL compiler to create the x stub and x server functions to compile and link to your client and server code to make RPC work.
Microsoft uses IDL (I think they have a MIDL compiler) for COM stuff. I also used third-party products with MS operating systems, both DCE and ONC RPC.