Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

neurobazaar/csc435-grpc-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSC435 gRPC Tutorial

Jarvis College of Computing and Digital Media - DePaul University

Requirements

To run the C++ programs you will need to have GCC 12.x and CMake 3.22.x installed on your system. You will also need to install Google Protocol Buffers (ProtoBuf) and gRPC libraries and development files. On Ubuntu 22.04 you can install GCC, CMake, ProtoBuf and gRPC, and set GCC as default compiler using the following commands:

sudo apt install g++-12 gcc-12 cmake
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 120
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 110
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 120
sudo apt install protobuf-compiler libprotobuf-dev protobuf-compiler-grpc libgrpc++-dev

To run the Java programs you will need to have Java 1.7.x and Maven 3.6.x installed on your systems. On Ubuntu 22.04 you can install Java and Maven using the following commands:

sudo apt install openjdk-17-jdk maven

C++ solution

How to build/compile

To build the C++ solution use the following commands:

cd app-cpp
mkdir build
cmake -S . -B build
cmake --build build

How to run application

To run the C++ server (after you build the project) use the following command:

./build/server <IP address> <port>
> [quit]

To run the C++ client (after you build the project) use the following command:

./build/client <IP address> <port>

Example

Server

./build/server 127.0.0.1 12345 2
> quit

Client 1

./build/client 127.0.0.1 12345
2+2=4
2x2=4

Client 2

./build/client 127.0.0.1 12345
2+2=4
2x2=4

Java solution

How to build/compile

To build the Java solution use the following commands:

cd app-java
mvn compile
mvn package

How to run application

To run the Java Server (after you build the project) use the following command:

java -cp target/app-java-1.0-SNAPSHOT.jar csc435.app.Server <IP address> <port>
> [quit]

To run the Java Client (after you build the project) use the following command:

java -cp target/app-java-1.0-SNAPSHOT.jar csc435.app.Client <IP address> <port>

Example

Server

java -cp target/app-java-1.0-SNAPSHOT.jar csc435.app.Server 127.0.0.1 12345
> quit

Client 1

java -cp target/app-java-1.0-SNAPSHOT.jar csc435.app.Client 127.0.0.1 12345
2+2=4
2x2=4

Client 2

java -cp target/app-java-1.0-SNAPSHOT.jar csc435.app.Client 127.0.0.1 12345
2+2=4
2x2=4

About

CSC435 gRPC Tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published