Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

CS 3700 Assignment 02: Pyro5 Protocol — Echo Server Method Call

Your name

Your student ID

Overview

In this assignment, you will call a remote method on a Pyro5 echo server using your from-scratch implementation of the Pyro5 wire protocol. Building on Assignment 01 (name-server lookup), you'll now send a method-call request, receive the response, and parse it.

By the end, you'll have written a client that:

  1. Takes a Pyro5 URI on the command line
  2. Opens a TCP connection to the name server to find the echo server
  3. Opens a TCP connection to the echo server
  4. Sends a correctly-framed echo("Hello, RPC!") method call
  5. Parses the response
  6. Prints the result

This teaches you the core RPC pattern: method invocation across the network, with automatic serialization/deserialization hidden from the caller.

Background: Method Calls in RPC

Once a client knows where a service is (via the name server lookup), it can call methods on it:

  1. Serialize the call: Package the method name, arguments, and options as bytes
  2. Send over TCP: Ship those bytes to the server
  3. Receive response: Read the server's reply
  4. Deserialize: Unpack the response back into usable data (result or exception)
  5. Return to caller: Pretend the call happened locally

Implement — Echo Server Client

See: https://pyro5.readthedocs.io/en/latest/api/echoserver.html

Design

Your client must:

  1. Receive a name server URI via the command line.
  2. Connect to the name server to retrieve the URI of the echo server
  3. Open a TCP socket to the echo server URI
  4. Send a handshake
  5. Receive handshake response
  6. Send a method-call request for echo("Hello, RPC!")
  7. Receive the response (the echoed string)
  8. Parse and print the result
  9. Close the connection gracefully

How to Run Your Program

Terminal 1 — Name Server:

$ python -m Pyro5.nameserver
Not starting broadcast server for IPv6.
NS running on localhost:9090 (::1)
URI = PYRO:Pyro.NameServer@localhost:9090

Terminal 2 — Echo Server:

$ pyro5-echoserver -n
Starting Pyro's built-in test echo server.
object name: test.echoserver
echo uri: PYRO:test.echoserver@localhost:62960
echoserver running.

Terminal 3: Run your client

Java:

javac src/*.java
java -cp src EchoClient # Name server URI

Python:

python echo_client.py # Name server URI

Output:

Connecting to PYRO:test.echoserver@127.0.0.1:57449...
Handshake successful
Calling echo("Hello, RPC!")...
Result: Hello, RPC!

Resources

Cite any resources you used. Include:


Academic Integrity & Professional Practices

You are encouraged to use all available resources. This mirrors real professional development:

✅ DO:

  • Search Stack Overflow, documentation, GitHub
  • Use AI (Claude, ChatGPT, Copilot) for explanations, debugging, ideas
  • Copy code from tutorials, examples, open-source projects
  • Ask classmates, TAs, instructor for help
  • Use libraries, frameworks, and tools

❌ DON'T:

  • Copy code without understanding it
  • Submit work entirely generated by AI without your input
  • Claim you wrote code you didn't write

The requirement: Cite all sources in a SOURCES.md file.

Penalty for missing citations: Automatic zero on assignment, regardless of code quality.

Why? Learn to work like a real engineer: use all available tools, but be transparent about sources.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors