home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / n / n001 / 2.ddi / EXAMPLES / MULTICLI / SERVER / RPROC.C next >
Encoding:
C/C++ Source or Header  |  1989-12-11  |  2.4 KB  |  71 lines

  1. /*                                                                            *
  2.  *                                                                            *
  3.  *                  Copyright 1987, 1988, 1989 Netwise, Inc.                  *
  4.  *                              All Rights Reserved                           *
  5.  *   This software contains information which is proprietary to and a trade   *
  6.  *   secret of Netwise, Inc. It is not to be used, reproduced, or disclosed   *
  7.  *   except as authorized in your license agreement.                          *
  8.  *                                                                            *
  9.  *                          Restricted Rights Legend                          *
  10.  *   Use, duplication,  or  disclosure  by the  Government  is  subject  to   *
  11.  *   restrictions as set forth in subparagraph (c)(1)(ii) of the Rights  in   *
  12.  *   Technical Data and  Computer Software clause  at 252.227-7013, or  the   *
  13.  *   equivalent Government clause for other agencies.                         *
  14.  *   Contractor: Netwise, Inc., Boulder, CO 80301 USA                         *
  15.  *                                                                            *
  16.  */ 
  17. /*                                                                            *
  18.  * File: multicli\server\rproc.c
  19.  *                                                                            *
  20.  * This example runs in the following environment:
  21.  *    NetWare RPC 1.0, NetWare 2.1 or higher, DOS 3.3
  22.  *
  23.  * This file contains the remote procedures for the multicli example.
  24.  *
  25.  */ 
  26.  
  27. #include <stdio.h>
  28. #include "multicli.h"    /* server header file, created by RPC compiler */
  29.  
  30. /* Note that the RPC Specification shows the declaration
  31.  * of the start procedure with a parameter called sname.
  32.  * Because this sname parameter contains process binding
  33.  * information, the client does not actually send the
  34.  * information passed with this parameter.  Therefore, the
  35.  * following declaration shows the start procedure without
  36.  * this parameter.
  37.  */
  38.  
  39. int start()
  40. {
  41.    printf("SERVER: connection accepted\n");
  42.  
  43.    return(1);
  44. }
  45.  
  46. int stop()
  47. {
  48.  
  49.    printf("SERVER: connection closed\n");
  50.  
  51.    return(1);
  52. }
  53.  
  54. int
  55. add( a, b)
  56. int a,b;
  57. {
  58.    printf("SERVER: Add %d to %d\n", b, a);
  59.  
  60.    return (a+b);
  61. }
  62.  
  63. int
  64. sub( a, b)
  65. int a,b;
  66. {
  67.    printf("SERVER: Subtract %d from %d\n", b, a);
  68.  
  69.    return (a-b);
  70. }
  71.