Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calc-rpc

A simple calculator built on Microsoft RPC (MIDL). The client and server are separate executables that talk to each other locally only — the transport is ncalrpc (Local RPC), so nothing is exposed over the network.

Operations: Add, Subtract, Multiply, Divide.

Files

File Purpose
calc.idl Interface definition (the four operations)
calc.acf Attribute config — declares the implicit binding handle
server.c Implements the functions, registers the interface, listens
client.c Binds to CalcEndpoint and calls each function

calc.h, calc_c.c and calc_s.c are generated by MIDL and are not committed.

Build

From a Developer Command Prompt for VS (or x64 Native Tools prompt):

midl calc.idl
cl server.c calc_s.c /link rpcrt4.lib
cl client.c calc_c.c /link rpcrt4.lib

Run

Start the server in one terminal:

server.exe

Then run the client in another:

client.exe

Output:

2 + 3  = 5
10 - 4 = 6
6 * 7  = 42
20 / 5 = 4

demo

Notes

  • Division by zero returns 0 instead of faulting.
  • The server runs until you stop it with Ctrl+C.

About

Simple calculator client/server built on Microsoft RPC (MIDL), using local-only ncalrpc transport.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages