- Use different threads to handle different clients as well as different tasks
- Use different ports to handle different services
See live demo.
---
---
title: RPC
title: Reminders
---
---
## Remote Procedure Call (RPC)
## Reminders
**Remote Procedure Call (RPC)** is a distributed computing technique in which a computer program calls a procedure (subroutine or service) to execute in a different address space than its own.
<divclass="container flex justify-center mt-5">
<imgsrc="/images/RPC.webp"class="block w-md"/>
</div>
**Language Specific**:
<br/>
- Java Remote Method Invocation (RMI)
- Last tutorial session
- Go RPC
- Last chance to present (vorrechnen) your assignment sheet
- ...
---
## Today's topics
title: RMI
---
## Java Remote Method Invocation (RMI)
It is a mechanism that allows an object residing in one system (JVM) to access/invoke an object running on another JVM.
<br/>
<divclass="container flex justify-center mt-5">
- Exam preparation
<imgsrc="/images/RMI.webp"class="block w-md"/>
- More on Web Development
</div>
**Note:** RMI is a Java-specific implementation of RPC.
---
---
title: RPC in Python
title: Exam Preparation
layout: two-cols
---
---
## Exercise: Using RPC in Python
## Relevant topics
Python provides built-in support for RPC through the [xmlrpc](https://docs.python.org/3/library/xmlrpc.html) module.
1. Try the example in `exercises/python-rpc` with your teammates.
- Concurrency, Determinism
2. Modify the example to implement RPC services that sends bytes of a file (e.g. `yourimage.jpg`) to the client.
- Critical Sections, Threads, Locks
- Petri Nets
- Semaphores, Monitors
- Deadlocks
- Parallel Programming (OpenMP, MPI)
- IPC/RPC
- P2P Networks
- Cloud Computing
- Web Development
**Hint**:
::right::
- Use `open` to open a file and read it in binary mode.
## Non-relevant topics
- Use `xmlrpc.client.Binary` to wrap the bytes.
- You can find example in the documentation of [xmlrpc](https://docs.python.org/3/library/xmlrpc.html).
---
title: P2P
---
# Recaps & Discussion - P2P
Discuss the following topics and explain those concepts in your own words to your teammates:
<br/>
- What is peer-to-peer (P2P) architecture?
- What are the use cases/examples of P2P?
- What are the different types of P2P network?
- What are the advantages and disadvantages of these type of P2P networks?
- What are the advantages and disadvantages of P2P itself?
---
title: Cloud Computing
---
# Cloud Computing
- Java RMI
Discuss the following topics and explain those concepts in your own words to your teammates: