10

I want to learn programming C++ (native) on Windows platform for RPC communication. I want to learn both server and client side. I also want to learn some advanced topics, like performance and security.

Any good recommended materials to read?

(BTW: I Googled a few, but all of them either too brief or COM related, I want to learn pure RPC programming without COM. I am using VSTS 2008 with C++.)

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
George2
  • 44,761
  • 110
  • 317
  • 455
  • 1
    I am not programming socket, but developing RPC client and server. Any recommended readings according to my points in my question? – George2 Oct 18 '09 at 16:11
  • 1
    Are you looking at REST or SOAP? There are others, but these are the popular ones. – DigitalZebra Oct 18 '09 at 16:25
  • 1
    No, I am looking for RPC, pure RPC programming. Any recommended readings? – George2 Oct 18 '09 at 16:27
  • 1
    Well you need a protocol by which to do RPC... that is what SOAP and REST are: ways for programs to talk to each other to execute RPCs. – DigitalZebra Oct 18 '09 at 16:30
  • 1
    I know SOAP/REST can do the same thing, but I am maintaining a legacy system which uses RPC. So, Any recommended tutorials? – George2 Oct 18 '09 at 16:33

6 Answers6

11

I would start with the Platform SDK samples on RPC.

  • ASYNCRPC illustrates the structure of an RPC application that uses asynchronous remote procedure calls. It also demonstrates various methods of notification of the call's completion.
  • CLUUID demonstrates use of the client-object UUID to enable a client to select from multiple implementations of a remote procedure.
  • DATA directory contains four programs:
    • DUNION illustrates discriminated (nonencapsulated) unions;
    • INOUT demonstrates [in], [out] parameters;
    • REPAS demonstrates the represent_as attribute;
    • XMIT demonstrates the transmit_as attribute.
  • DYNEPT demonstrates a client application managing its connection to the server through dynamic endpoints.
  • FILEREP directory contains four samples illustrating how developers can write a simple file replication service, a multi-user file replication service, a service supporting security features, and a service using RPC asynchronous pipes.
  • HANDLES directory contains three programs, AUTO, CXHNDL, USRDEF, which demonstrate auto_handle, [context_handle], and generic (user-defined) handles, respectively.
  • HELLO is a client/server implementation of "Hello, world."
  • PICKLE directory contains two programs:
    • PICKLP demonstrates data procedure serialization;
    • PICKLT demonstrates data type serialization; both programs use the [encode] and [decode] attributes.
  • PIPES demonstrates the use of the pipe-type constructor.
  • RPCSVC demonstrates the implementation of a service with RPC.
  • STROUT demonstrates how to allocate memory at a server for a two-dimensional object (an array of pointers) and pass it back to the client as an [out]-only parameter. The client then frees the memory. This technique allows the stub to call the server without knowing in advance how much data will be returned.
Shay Erlichmen
  • 31,691
  • 7
  • 68
  • 87
  • Thanks Shay! The link you recommended really contains good code samples. What I need besides code samples are a comprehensive documents which describes the RPC programming, internals, tricks, etc. Any recommended documents besides code? – George2 Oct 18 '09 at 16:21
  • 1
    Well there is the MSDN, and properly some old books, but RPC is dead in so many ways: most ppl will use DCOM\Com+\ServicedComponent (which is based on RPC) and the really cool kids are playing with WCF. – Shay Erlichmen Oct 18 '09 at 16:32
  • Well I agree. But since I am maintaining some legacy system which is using RPC, I have to use and learn RPC. Any recommended readings (I need to learn some background which could facilitate me to understand the excellent RPC samples you mentioned)? – George2 Oct 18 '09 at 16:39
9

Try this:

Overview

Technical Reference - also describes what it is & how it works

slashmais
  • 7,069
  • 9
  • 54
  • 80
4

why do you want to learn "raw" RPC? there are many good higher level RPC implementations:

  1. CORBA implementations
  2. google's protocol buffers
  3. Thrift
geva30
  • 325
  • 2
  • 7
  • I am integrating with some legacy systems which uses RPC as programming protocol. So, any recommended readings on this topic? – George2 Oct 18 '09 at 16:28
3

You need to learn 3 different things probably:

  • The C++ programming language
  • RPC
  • Some C++ RPC library
dirkgently
  • 108,024
  • 16
  • 131
  • 187
2

RPC == "Remote Procedure Call"

Essentially, its the idea that communications between two endpoints is best modeled on the concept of those endpoints making logical function calls on each other. In general one side "publishes" an API in some way (for example, if your using SOAP, typically you'll have a file called a WSDL (pronounced wizdel) that enumerates the functions you respond to... a client will first download your WSDL and then make calls to your available API's)... These days, almost all of the available technologies will layer their specific protocols on top of HTTP (for example Web Services, UPnP, REST).. This generally means you're servers are implemented on top of web servers...

So, if all you need to implement is the client side, then you can probably use libcurl for all of your HTTP needs...

dicroce
  • 45,396
  • 28
  • 101
  • 140
  • Thanks dicroce! What you mentioned is very excellent! As a beginner for RPC, what I need besides code samples are a comprehensive documents which describes the RPC programming, internals, tricks, etc. Any recommended documents besides code? – George2 Oct 18 '09 at 16:26
1

Have a look to RCF, Deltavsoft_Link and CodeProject_Link

Main behavior is that RCF doesn't use a separate IDL (Interface Definition Language).

Abhineet
  • 5,320
  • 1
  • 25
  • 43
Jean Davy
  • 2,062
  • 1
  • 19
  • 24