Issuing RPCs
In this part, you will send requests to your server by invoking RPCs from the client.
Currently, src/client.rs
contains an example
function for sending an Example
RPC. In a similar manner, implement the echo
function to first connect to the server, then send an ECHO
RPC.
To retrieve an
EchoReply
from aResponse<EchoReply>
, you may find theinto_inner
function useful. You may want to take a look at how theexample
function recovers anExampleReply
from aResponse<ExampleReply>
.
You should now be able to run ./target/debug/client echo test
and get an output of test
. Make sure you compile your code with cargo b
and that your server is running first.