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:
- Takes a Pyro5 URI on the command line
- Opens a TCP connection to the name server to find the echo server
- Opens a TCP connection to the echo server
- Sends a correctly-framed
echo("Hello, RPC!")method call - Parses the response
- Prints the result
This teaches you the core RPC pattern: method invocation across the network, with automatic serialization/deserialization hidden from the caller.
Once a client knows where a service is (via the name server lookup), it can call methods on it:
- Serialize the call: Package the method name, arguments, and options as bytes
- Send over TCP: Ship those bytes to the server
- Receive response: Read the server's reply
- Deserialize: Unpack the response back into usable data (result or exception)
- Return to caller: Pretend the call happened locally
See: https://pyro5.readthedocs.io/en/latest/api/echoserver.html
Your client must:
- Receive a name server URI via the command line.
- Connect to the name server to retrieve the URI of the echo server
- Open a TCP socket to the echo server URI
- Send a handshake
- Receive handshake response
- Send a method-call request for
echo("Hello, RPC!") - Receive the response (the echoed string)
- Parse and print the result
- Close the connection gracefully
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:9090Terminal 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 URIPython:
python echo_client.py # Name server URIOutput:
Connecting to PYRO:test.echoserver@127.0.0.1:57449...
Handshake successful
Calling echo("Hello, RPC!")...
Result: Hello, RPC!
Cite any resources you used. Include:
- Pyro5 wire protocol: https://pyro5.readthedocs.io/en/latest/api/protocol.html
- SERPENT_FORMAT.md (in Assignments directory)
- PYRO5_CLI.md (in Assignments directory)
- Any AI you used and include the prompts so it can be replicated
- Any other sources
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.