Commit c67a6f6d authored by Gabriele Civitarese's avatar Gabriele Civitarese

Small refactoring

parent 4db2957d
package grpchelloserver;
import com.example.grpc.GreetingServiceGrpc;
import com.example.grpc.GreetingServiceGrpc.*;
import com.example.grpc.GreetingServiceOuterClass.*;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
......@@ -36,7 +37,7 @@ public class GreetingServiceClient {
final ManagedChannel channel = ManagedChannelBuilder.forTarget("localhost:8080").usePlaintext(true).build();
//creating a blocking stub on the channel
GreetingServiceGrpc.GreetingServiceBlockingStub stub = GreetingServiceGrpc.newBlockingStub(channel);
GreetingServiceBlockingStub stub = GreetingServiceGrpc.newBlockingStub(channel);
//creating the HelloResponse object which will be provided as input to the RPC method
HelloRequest request = HelloRequest.newBuilder().setName("Pippo").build();
......@@ -59,7 +60,7 @@ public class GreetingServiceClient {
final ManagedChannel channel = ManagedChannelBuilder.forTarget("localhost:8080").usePlaintext(true).build();
//creating an asynchronous stub on the channel
GreetingServiceGrpc.GreetingServiceStub stub = GreetingServiceGrpc.newStub(channel);
GreetingServiceStub stub = GreetingServiceGrpc.newStub(channel);
//creating the HelloResponse object which will be provided as input to the RPC method
HelloRequest request = HelloRequest.newBuilder().setName("Pippo").build();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment