Home
 

Asynchronous RPC

Assignment

Source Files

sortHomework4.x
RPC Interface
sortHomework4.h sortHomework4_xdr.c, sortHomework4_svc.c, sortHomework4_clnt.c
Stubs generated by rpcgen with the Interface File
sortServerHomework4.c
Server Implementation
sortClientHomework4.c
Client Implementation

Documentation

Architecture
============

Server
------
The server greps the incoming request and stores its data.  It sends itself a
signal to process the data and returns to the client with no result.

The signal invokes a method that calculates the sorted list and sends it to
the client (specified by hostname and program number).

Client
------
The client creates a server (program number in transient area 0x40000000 to
0x5fffffff) for itself and sends the request to the real server (server can be
used for that too, so no extra client is necessary).  The request contains a
program number, a hostname and the unsorted list.  This data is necessary for
the callback.


Sample run
==========

Start server on allegro
    allegro 10>./sortServerHomework4

Run client on solar
    solar 4>./sortClientHomework4 allegro.cs.bgsu.edu
    Original data is:
    0: 0
    1: -1
    2: -2
    3: -3
    4: -4
    Call returned
    Waiting for callback on 1073741824
    Client got callback

    Processed data is:
    0: -4
    1: -3
    2: -2
    3: -1
    4: 0

Server log was
    Request received
    Processing
    Received data:
    0: 0
    1: -1
    2: -2
    3: -3
    4: -4

    Sorted data:
    0: -4
    1: -3
    2: -2
    3: -1
    4: 0

    Callback to program 1073741824 on host solar
    Request handled