diff options
Diffstat (limited to 'src/main/java/com/orbekk/protobuf/SimpleProtobufClient.java')
-rw-r--r-- | src/main/java/com/orbekk/protobuf/SimpleProtobufClient.java | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/main/java/com/orbekk/protobuf/SimpleProtobufClient.java b/src/main/java/com/orbekk/protobuf/SimpleProtobufClient.java index b17c0bc..7d0dc6a 100644 --- a/src/main/java/com/orbekk/protobuf/SimpleProtobufClient.java +++ b/src/main/java/com/orbekk/protobuf/SimpleProtobufClient.java @@ -9,31 +9,31 @@ public class SimpleProtobufClient { static final Logger logger = Logger.getLogger(SimpleProtobufClient.class.getName()); - public void run() { - RpcChannel channel = RpcChannel.create("localhost", 10000); - Test.TestService test = Test.TestService.newStub(channel); - Test.TestRequest request = Test.TestRequest.newBuilder() - .setId("Hello!") - .build(); - int count = 10; - final CountDownLatch stop = new CountDownLatch(count); - for (int i = 0; i < count; i++) { - logger.info("Sending request."); - test.run(null, request, new RpcCallback<Test.TestResponse>() { - @Override public void run(Test.TestResponse response) { - System.out.println("Response from server: " + response); - stop.countDown(); - } - }); - } - try { - stop.await(); - } catch (InterruptedException e) { - // Stop waiting. - } - } - - public static void main(String[] args) { - new SimpleProtobufClient().run(); - } +// public void run() { +// RpcChannel channel = RpcChannel.create("localhost", 10000); +// Test.TestService test = Test.TestService.newStub(channel); +// Test.TestRequest request = Test.TestRequest.newBuilder() +// .setId("Hello!") +// .build(); +// int count = 10; +// final CountDownLatch stop = new CountDownLatch(count); +// for (int i = 0; i < count; i++) { +// logger.info("Sending request."); +// test.run(null, request, new RpcCallback<Test.TestResponse>() { +// @Override public void run(Test.TestResponse response) { +// System.out.println("Response from server: " + response); +// stop.countDown(); +// } +// }); +// } +// try { +// stop.await(); +// } catch (InterruptedException e) { +// // Stop waiting. +// } +// } +// +// public static void main(String[] args) { +// new SimpleProtobufClient().run(); +// } } |