Merge remote-tracking branch 'upstream/revert-1980-revert-1948-poisson' into qps-proto3

Conflicts:
	test/cpp/qps/qps_test_openloop.cc
pull/1958/head
vjpai 10 years ago
commit 37253d967b
  1. 24
      Makefile
  2. 2
      README.md
  3. 1
      build.json
  4. 38
      gRPC.podspec
  5. 6
      include/grpc/grpc.h
  6. 2
      src/core/iomgr/resolve_address_windows.c
  7. 2
      src/core/iomgr/socket_windows.c
  8. 11
      src/core/transport/chttp2_transport.c
  9. 120
      src/objective-c/README.md
  10. 1
      src/objective-c/examples/Sample/Podfile
  11. 33
      src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h
  12. 59
      src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m
  13. 221
      src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h
  14. 603
      src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m
  15. 32
      src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec
  16. 12
      src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h
  17. 9
      src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m
  18. 59
      src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h
  19. 96
      src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m
  20. 134
      src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.h
  21. 355
      src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.m
  22. 43
      src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.h
  23. 72
      src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.m
  24. 26
      src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.podspec
  25. 24
      src/objective-c/generated_libraries/RouteGuideClient/Route_guide.podspec
  26. 2
      src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto
  27. 82
      src/objective-c/tests/LocalClearTextTests.m
  28. 3
      src/objective-c/tests/Podfile
  29. 47
      src/ruby/ext/grpc/extconf.rb
  30. 2
      src/ruby/grpc.gemspec
  31. 2
      src/ruby/lib/grpc/version.rb
  32. 3
      templates/tools/doxygen/Doxyfile.include
  33. 21
      test/core/bad_client/bad_client.c
  34. 11
      test/core/bad_client/bad_client.h
  35. 1
      test/core/bad_client/gen_build_json.py
  36. 60
      test/core/bad_client/tests/connection_prefix.c
  37. 95
      test/core/bad_client/tests/initial_settings_frame.c
  38. 69
      test/core/httpcli/httpcli_test.c
  39. 31
      test/core/httpcli/test_server.py
  40. 2
      test/core/network_benchmarks/low_level_ping_pong.c
  41. 9
      test/cpp/qps/client_async.cc
  42. 2
      test/cpp/qps/qps_driver.cc
  43. 2
      test/cpp/qps/qps_test.cc
  44. 2
      test/cpp/qps/qps_test_openloop.cc
  45. 10
      test/cpp/qps/report.cc
  46. 9
      test/cpp/qps/report.h
  47. 2
      tools/dockerfile/grpc_java/Dockerfile
  48. 28
      tools/dockerfile/grpc_java_base/Dockerfile
  49. 2
      tools/doxygen/Doxyfile.c++.internal
  50. 2
      tools/doxygen/Doxyfile.core.internal
  51. 36
      tools/jenkins/grpc_jenkins_slave/Dockerfile
  52. 4
      tools/jenkins/run_jenkins.sh
  53. 2
      tools/run_tests/build_node.sh
  54. 18
      tools/run_tests/tests.json
  55. 9
      vsprojects/Grpc.mak

File diff suppressed because one or more lines are too long

@ -39,8 +39,8 @@ Libraries in different languages are in different state of development. We are s
* Ruby Library: [src/ruby] (src/ruby) : Early adopter ready - Alpha.
* NodeJS Library: [src/node] (src/node) : Early adopter ready - Alpha.
* Python Library: [src/python] (src/python) : Early adopter ready - Alpha.
* C# Library: [src/csharp] (src/csharp) : Early adopter ready - Alpha.
* PHP Library: [src/php] (src/php) : Pre-Alpha.
* C# Library: [src/csharp] (src/csharp) : Pre-Alpha.
* Objective-C Library: [src/objective-c] (src/objective-c): Pre-Alpha.
#Overview

@ -1352,7 +1352,6 @@
{
"name": "httpcli_test",
"build": "test",
"run": false,
"language": "c",
"src": [
"test/core/httpcli/httpcli_test.c"

@ -13,23 +13,27 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.8'
s.requires_arc = true
# Reactive Extensions library for iOS.
s.subspec 'RxLibrary' do |rs|
rs.summary = 'Reactive Extensions library for iOS.'
rs.source_files = 'src/objective-c/RxLibrary/*.{h,m}',
'src/objective-c/RxLibrary/transformations/*.{h,m}',
'src/objective-c/RxLibrary/private/*.{h,m}'
rs.private_header_files = 'src/objective-c/RxLibrary/private/*.h'
end
# Core cross-platform gRPC library, written in C.
s.subspec 'C-Core' do |cs|
cs.summary = 'Core cross-platform gRPC library, written in C.'
cs.source_files = 'src/core/**/*.{h,c}', 'include/grpc/*.h', 'include/grpc/**/*.h'
cs.private_header_files = 'src/core/**/*.h'
cs.header_mappings_dir = '.'
cs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Build/gRPC" '
'"$(PODS_ROOT)/Headers/Build/gRPC/include"' }
# The core library includes its headers as either "src/core/..." or "grpc/...", meaning we have
# to tell XCode to look for headers under the "include" subdirectory too.
#
# TODO(jcanizales): Instead of doing this, during installation move everything under
# "include/grpc" one directory up. The directory names under PODS_ROOT are implementation
# details of Cocoapods, and have changed in the past, breaking this podspec.
cs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/gRPC" ' +
'"$(PODS_ROOT)/Headers/Private/gRPC/include"' }
cs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
cs.requires_arc = false
@ -41,35 +45,38 @@ Pod::Spec.new do |s|
# It renames time.h and string.h to grpc_time.h and grpc_string.h.
# It needs to be here (top-level) instead of in the C-Core subspec because Cocoapods doesn't run
# prepare_command's of subspecs.
#
# TODO(jcanizales): Try out Todd Reed's solution at Issue #1437.
s.prepare_command = <<-CMD
DIR_TIME="grpc/support"
BAD_TIME="$DIR_TIME/time.h"
GOOD_TIME="$DIR_TIME/grpc_time.h"
grep -rl "$BAD_TIME" include/grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
if [ -f "include/$BAD_TIME" ];
then
grep -rl "$BAD_TIME" include/grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
mv "include/$BAD_TIME" "include/$GOOD_TIME"
mv -f "include/$BAD_TIME" "include/$GOOD_TIME"
fi
DIR_STRING="src/core/support"
BAD_STRING="$DIR_STRING/string.h"
GOOD_STRING="$DIR_STRING/grpc_string.h"
grep -rl "$BAD_STRING" include/grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
if [ -f "$BAD_STRING" ];
then
grep -rl "$BAD_STRING" include/grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
mv "$BAD_STRING" "$GOOD_STRING"
mv -f "$BAD_STRING" "$GOOD_STRING"
fi
CMD
# Objective-C wrapper around the core gRPC library.
s.subspec 'GRPCClient' do |gs|
gs.summary = 'Objective-C wrapper around the core gRPC library.'
gs.source_files = 'src/objective-c/GRPCClient/*.{h,m}',
'src/objective-c/GRPCClient/private/*.{h,m}'
gs.private_header_files = 'src/objective-c/GRPCClient/private/*.h'
gs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
gs.dependency 'gRPC/C-Core'
# Is this needed in all dependents?
# TODO(jcanizales): Remove this when the prepare_command moves everything under "include/grpc"
# one directory up.
gs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Public/gRPC/include"' }
gs.dependency 'gRPC/RxLibrary'
@ -77,13 +84,12 @@ Pod::Spec.new do |s|
gs.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
end
# RPC library for ProtocolBuffers, based on gRPC
s.subspec 'ProtoRPC' do |ps|
ps.summary = 'RPC library for ProtocolBuffers, based on gRPC'
ps.source_files = 'src/objective-c/ProtoRPC/*.{h,m}'
ps.dependency 'gRPC/GRPCClient'
ps.dependency 'gRPC/RxLibrary'
ps.dependency 'Protobuf', '~> 3.0'
ps.dependency 'Protobuf', '~> 3.0.0-alpha-3'
end
end

@ -361,7 +361,8 @@ grpc_completion_queue *grpc_completion_queue_create(void);
/** Blocks until an event is available, the completion queue is being shut down,
or deadline is reached.
Returns NULL on timeout, otherwise the event that occurred.
Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,
otherwise a grpc_event describing the event that occurred.
Callers must not call grpc_completion_queue_next and
grpc_completion_queue_pluck simultaneously on the same completion queue. */
@ -371,7 +372,8 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cq,
/** Blocks until an event with tag 'tag' is available, the completion queue is
being shutdown or deadline is reached.
Returns NULL on timeout, or a pointer to the event that occurred.
Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,
otherwise a grpc_event describing the event that occurred.
Callers must not call grpc_completion_queue_next and
grpc_completion_queue_pluck simultaneously on the same completion queue. */

@ -135,9 +135,9 @@ static void do_request(void *rp) {
grpc_resolve_cb cb = r->cb;
gpr_free(r->name);
gpr_free(r->default_port);
grpc_iomgr_unregister_object(&r->iomgr_object);
gpr_free(r);
cb(arg, resolved);
grpc_iomgr_unregister_object(&r->iomgr_object);
}
void grpc_resolved_addresses_destroy(grpc_resolved_addresses *addrs) {

@ -85,13 +85,13 @@ int grpc_winsocket_shutdown(grpc_winsocket *socket) {
both memory and sockets. */
void grpc_winsocket_orphan(grpc_winsocket *winsocket) {
SOCKET socket = winsocket->socket;
grpc_iomgr_unregister_object(&winsocket->iomgr_object);
if (winsocket->read_info.outstanding || winsocket->write_info.outstanding) {
grpc_iocp_socket_orphan(winsocket);
} else {
grpc_winsocket_destroy(winsocket);
}
closesocket(socket);
grpc_iomgr_unregister_object(&winsocket->iomgr_object);
}
void grpc_winsocket_destroy(grpc_winsocket *winsocket) {

@ -1575,12 +1575,21 @@ static int init_goaway_parser(transport *t) {
}
static int init_settings_frame_parser(transport *t) {
int ok = GRPC_CHTTP2_PARSE_OK ==
int ok;
if (t->incoming_stream_id != 0) {
gpr_log(GPR_ERROR, "settings frame received for stream %d", t->incoming_stream_id);
drop_connection(t);
return 0;
}
ok = GRPC_CHTTP2_PARSE_OK ==
grpc_chttp2_settings_parser_begin_frame(
&t->simple_parsers.settings, t->incoming_frame_size,
t->incoming_frame_flags, t->settings[PEER_SETTINGS]);
if (!ok) {
drop_connection(t);
return 0;
}
if (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_ACK) {
memcpy(t->settings[ACKED_SETTINGS], t->settings[SENT_SETTINGS],

@ -1,78 +1,89 @@
# gRPC for Objective-C
- [Install protoc with the gRPC plugin](#install)
- [Use protoc to generate a gRPC library](#protoc)
- [Integrate the generated gRPC library in your project](#cocoapods)
- [Write your API declaration in proto format](#write-protos)
- [Integrate a proto library in your project](#cocoapods)
- [Use the generated library in your code](#use)
- [Alternative methods](#alternatives)
- [Install protoc and the gRPC plugin without using Homebrew](#nohomebrew)
- [Integrate the generated gRPC library without using Cocoapods](#nococoapods)
- [Use gRPC without Protobuf](#no-proto)
- [Alternative installation methods](#alternatives)
- [Install protoc and the gRPC plugin without using Homebrew](#no-homebrew)
- [Integrate the generated gRPC library without using Cocoapods](#no-cocoapods)
While gRPC doesn't require the use of an IDL to describe the API of services, using one simplifies
usage and adds some interoperability guarantees. Here we use [Protocol Buffers][], and provide a
plugin for the Protobuf Compiler (_protoc_) to generate client libraries to communicate with gRPC
services.
<a name="install"></a>
## Install protoc with the gRPC plugin
On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][].
Run the following command to install the Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin:
Run the following command to install _protoc_ and the gRPC _protoc_ plugin:
```sh
$ curl -fsSL https://goo.gl/getgrpc | bash -
```
This will download and run the [gRPC install script][]. After the command completes, you're ready to proceed.
<a name="protoc"></a>
## Use protoc to generate a gRPC library
This will download and run the [gRPC install script][]. After the command completes, you're ready to
proceed.
Run _protoc_ with the following flags to generate the client library for your `.proto` files:
```sh
protoc --objc_out=. --objcgrpc_out=. *.proto
```
<a name="write-protos"></a>
## Write your API declaration in proto format
This will generate a pair of `.pbobjc.h`/`.pbobjc.m` files for each `.proto` file, with the messages and enums defined in them. And a pair of `.pbrpc.h`/`.pbrpc.m` files for each `.proto` file with services defined. The latter contains the code to make remote calls to the specified API.
For this you can consult the [Protocol Buffers][]' official documentation, or learn from a quick
example [here](https://github.com/grpc/grpc-common#defining-a-service).
<a name="cocoapods"></a>
## Integrate the generated gRPC library in your project
## Integrate a proto library in your project
Install [Cocoapods](https://cocoapods.org/#install).
You need to create a Podspec file for the generated library. You may simply copy the following example to the directory where the source files were generated, updating the name and other metadata of the Podspec as necessary:
You need to create a Podspec file for your proto library. You may simply copy the following example
to the directory where your `.proto` files are located, updating the name, version and license as
necessary:
```ruby
Pod::Spec.new do |s|
s.name = '<Podspec file name>'
s.version = '...'
s.summary = 'Client library to make RPCs to <my proto API>'
s.homepage = '...'
s.version = '0.0.1'
s.license = '...'
s.authors = { '<my name>' => '<my email>' }
s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
s.subspec 'Messages' do |ms|
ms.source_files = '*.pbobjc.{h,m}', '**/*.pbobjc.{h,m}'
ms.header_mappings_dir = '.'
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
# You can run this command manually if you later change your protos and need to regenerate.
s.prepare_command = "protoc --objc_out=. --objcgrpc_out=. *.proto **/*.proto"
# The --objc_out plugin generates a pair of .pbobjc.h/.pbobjc.m files for each .proto file.
s.subspec "Messages" do |ms|
ms.source_files = "*.pbobjc.{h,m}", "**/*.pbobjc.{h,m}"
ms.header_mappings_dir = "."
ms.requires_arc = false
ms.dependency 'Protobuf', '~> 3.0'
ms.dependency "Protobuf", "~> 3.0.0-alpha-3"
end
s.subspec 'Services' do |ss|
ss.source_files = '*.pbrpc.{h,m}', '**/*.pbrpc.{h,m}'
ss.header_mappings_dir = '.'
# The --objcgrpc_out plugin generates a pair of .pbrpc.h/.pbrpc.m files for each .proto file with
# a service defined.
s.subspec "Services" do |ss|
ss.source_files = "*.pbrpc.{h,m}", "**/*.pbrpc.{h,m}"
ss.header_mappings_dir = "."
ss.requires_arc = true
ss.dependency 'gRPC', '~> 0.0'
ss.dependency '<Podspec file name>/Messages'
ss.dependency "gRPC", "~> 0.5"
ss.dependency "#{s.name}/Messages"
end
end
```
The file should be named `<Podspec file name>.podspec`. You can refer to this [example Podspec][]. Once your library has a Podspec, Cocoapods can install it into any XCode project. For that, go into your project's directory and create a Podfile by running:
The file should be named `<Podspec file name>.podspec`. Once your library has a Podspec, Cocoapods
can install it into any XCode project. For that, go into your project's directory and create a
Podfile by running:
```sh
pod init
```
Next add a line to your Podfile to refer to your library's Podspec. Use `:path` as described [here](https://guides.cocoapods.org/using/the-podfile.html#using-the-files-from-a-folder-local-to-the-machine):
Next add a line to your Podfile to refer to your library's Podspec. Use `:path` as described
[here](https://guides.cocoapods.org/using/the-podfile.html#using-the-files-from-a-folder-local-to-the-machine):
```ruby
pod '<Podspec file name>', :path => 'path/to/the/directory/of/your/podspec'
@ -91,15 +102,25 @@ pod install
Please check this [sample app][] for examples of how to use a generated gRPC library.
<a name="no-proto"></a>
## Use gRPC without Protobuf
The [sample app][] has an example of how to use the generic gRPC Objective-C client without
generated files.
<a name="alternatives"></a>
## Alternative methods
## Alternative installation methods
<a name="nohomebrew"></a>
<a name="no-homebrew"></a>
### Install protoc and the gRPC plugin without using Homebrew
First install v3 of the Protocol Buffers compiler (_protoc_), by cloning [its Git repository](https://github.com/google/protobuf) and following these [installation instructions](https://github.com/google/protobuf#c-installation---unix) (the ones titled C++; don't miss the note for Mac users).
First install v3 of the Protocol Buffers compiler (_protoc_), by cloning
[its Git repository](https://github.com/google/protobuf) and following these
[installation instructions](https://github.com/google/protobuf#c-installation---unix)
(the ones titled C++; don't miss the note for Mac users).
Then clone this repository and execute the following commands from the root directory where it was cloned.
Then clone this repository and execute the following commands from the root directory where it was
cloned.
Compile the gRPC plugins for _protoc_:
```sh
@ -110,23 +131,32 @@ Create a symbolic link to the compiled plugin binary somewhere in your `$PATH`:
```sh
ln -s `pwd`/bins/opt/grpc_objective_c_plugin /usr/local/bin/protoc-gen-objcgrpc
```
(Notice that the name of the created link must begin with "protoc-gen-" for _protoc_ to recognize it as a plugin).
(Notice that the name of the created link must begin with "protoc-gen-" for _protoc_ to recognize it
as a plugin).
If you don't want to create the symbolic link, you can alternatively copy the binary (with the appropriate name). Or you might prefer instead to specify the plugin's path as a flag when invoking _protoc_, in which case no system modification nor renaming is necessary.
If you don't want to create the symbolic link, you can alternatively copy the binary (with the
appropriate name). Or you might prefer instead to specify the plugin's path as a flag when invoking
_protoc_, in which case no system modification nor renaming is necessary.
<a name="nococoapods"></a>
<a name="no-cocoapods"></a>
### Integrate the generated gRPC library without using Cocoapods
You need to compile the generated `.pbpbjc.*` files (the enums and messages) without ARC support, and the generated `.pbrpc.*` files (the services) with ARC support. The generated code depends on v0.3+ of the Objective-C gRPC runtime library and v3.0+ of the Objective-C Protobuf runtime library.
You need to compile the generated `.pbpbjc.*` files (the enums and messages) without ARC support,
and the generated `.pbrpc.*` files (the services) with ARC support. The generated code depends on
v0.5+ of the Objective-C gRPC runtime library and v3.0.0-alpha-3+ of the Objective-C Protobuf
runtime library.
These libraries need to be integrated into your project as described in their respective Podspec files:
These libraries need to be integrated into your project as described in their respective Podspec
files:
* [Podspec](https://github.com/grpc/grpc/blob/master/gRPC.podspec) for the Objective-C gRPC runtime library. This can be tedious to configure manually.
* [Podspec](https://github.com/jcanizales/protobuf/blob/add-podspec/Protobuf.podspec) for the Objective-C Protobuf runtime library.
* [Podspec](https://github.com/grpc/grpc/blob/master/gRPC.podspec) for the Objective-C gRPC runtime
library. This can be tedious to configure manually.
* [Podspec](https://github.com/jcanizales/protobuf/blob/add-podspec/Protobuf.podspec) for the
Objective-C Protobuf runtime library.
[Protocol Buffers]:https://developers.google.com/protocol-buffers/
[homebrew]:http://brew.sh
[linuxbrew]:https://github.com/Homebrew/linuxbrew
[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
[example Podspec]:https://github.com/grpc/grpc/blob/master/src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec
[example Podfile]:https://github.com/grpc/grpc/blob/master/src/objective-c/examples/Sample/Podfile
[sample app]: https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample

@ -2,7 +2,6 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'gRPC', :path => "../../../.."
pod 'Protobuf', :git => 'https://github.com/google/protobuf.git'
pod 'RemoteTest', :path => "../../generated_libraries/RemoteTestClient"
target 'Sample' do

@ -1,33 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: empty.proto
#import "GPBProtocolBuffers.h"
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
#endif
CF_EXTERN_C_BEGIN
@class RMTEmpty;
#pragma mark - RMTEmptyRoot
@interface RMTEmptyRoot : GPBRootObject
@end
#pragma mark - RMTEmpty
// An empty message that you can re-use to avoid defining duplicated empty
// messages in your project. A typical example is to use it as argument or the
// return value of a service API. For instance:
//
// service Foo {
// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
// };
@interface RMTEmpty : GPBMessage
@end
CF_EXTERN_C_END

@ -1,59 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: empty.proto
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "Empty.pbobjc.h"
#pragma mark - RMTEmptyRoot
@implementation RMTEmptyRoot
@end
static GPBFileDescriptor *RMTEmptyRoot_FileDescriptor(void) {
// This is called by +initialize so there is no need to worry
// about thread safety of the singleton.
static GPBFileDescriptor *descriptor = NULL;
if (!descriptor) {
descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.testing"
syntax:GPBFileSyntaxProto3];
}
return descriptor;
}
#pragma mark - RMTEmpty
@implementation RMTEmpty
typedef struct RMTEmpty_Storage {
uint32_t _has_storage_[0];
} RMTEmpty_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RMTEmpty class]
rootClass:[RMTEmptyRoot class]
file:RMTEmptyRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RMTEmpty_Storage)
wireFormat:NO];
}
return descriptor;
}
@end

@ -1,221 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: messages.proto
#import "GPBProtocolBuffers.h"
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
#endif
CF_EXTERN_C_BEGIN
@class RMTPayload;
@class RMTResponseParameters;
@class RMTSimpleRequest;
@class RMTSimpleResponse;
@class RMTStreamingInputCallRequest;
@class RMTStreamingInputCallResponse;
@class RMTStreamingOutputCallRequest;
@class RMTStreamingOutputCallResponse;
#pragma mark - Enum RMTPayloadType
// The type of payload that should be returned.
typedef GPB_ENUM(RMTPayloadType) {
RMTPayloadType_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue,
// Compressable text format.
RMTPayloadType_Compressable = 0,
// Uncompressable binary format.
RMTPayloadType_Uncompressable = 1,
// Randomly chosen from all other formats defined in this enum.
RMTPayloadType_Random = 2,
};
GPBEnumDescriptor *RMTPayloadType_EnumDescriptor(void);
BOOL RMTPayloadType_IsValidValue(int32_t value);
#pragma mark - RMTMessagesRoot
@interface RMTMessagesRoot : GPBRootObject
@end
#pragma mark - RMTPayload
typedef GPB_ENUM(RMTPayload_FieldNumber) {
RMTPayload_FieldNumber_Type = 1,
RMTPayload_FieldNumber_Body = 2,
};
// A block of data, to simply increase gRPC message size.
@interface RMTPayload : GPBMessage
// The type of data in body.
@property(nonatomic, readwrite) RMTPayloadType type;
// Primary contents of payload.
@property(nonatomic, readwrite, copy) NSData *body;
@end
int32_t RMTPayload_Type_RawValue(RMTPayload *message);
void SetRMTPayload_Type_RawValue(RMTPayload *message, int32_t value);
#pragma mark - RMTSimpleRequest
typedef GPB_ENUM(RMTSimpleRequest_FieldNumber) {
RMTSimpleRequest_FieldNumber_ResponseType = 1,
RMTSimpleRequest_FieldNumber_ResponseSize = 2,
RMTSimpleRequest_FieldNumber_Payload = 3,
RMTSimpleRequest_FieldNumber_FillUsername = 4,
RMTSimpleRequest_FieldNumber_FillOauthScope = 5,
};
// Unary request.
@interface RMTSimpleRequest : GPBMessage
// Desired payload type in the response from the server.
// If response_type is RANDOM, server randomly chooses one from other formats.
@property(nonatomic, readwrite) RMTPayloadType responseType;
// Desired payload size in the response from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression.
@property(nonatomic, readwrite) int32_t responseSize;
// Optional input payload sent along with the request.
@property(nonatomic, readwrite) BOOL hasPayload;
@property(nonatomic, readwrite, strong) RMTPayload *payload;
// Whether SimpleResponse should include username.
@property(nonatomic, readwrite) BOOL fillUsername;
// Whether SimpleResponse should include OAuth scope.
@property(nonatomic, readwrite) BOOL fillOauthScope;
@end
int32_t RMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message);
void SetRMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message, int32_t value);
#pragma mark - RMTSimpleResponse
typedef GPB_ENUM(RMTSimpleResponse_FieldNumber) {
RMTSimpleResponse_FieldNumber_Payload = 1,
RMTSimpleResponse_FieldNumber_Username = 2,
RMTSimpleResponse_FieldNumber_OauthScope = 3,
};
// Unary response, as configured by the request.
@interface RMTSimpleResponse : GPBMessage
// Payload to increase message size.
@property(nonatomic, readwrite) BOOL hasPayload;
@property(nonatomic, readwrite, strong) RMTPayload *payload;
// The user the request came from, for verifying authentication was
// successful when the client expected it.
@property(nonatomic, readwrite, copy) NSString *username;
// OAuth scope.
@property(nonatomic, readwrite, copy) NSString *oauthScope;
@end
#pragma mark - RMTStreamingInputCallRequest
typedef GPB_ENUM(RMTStreamingInputCallRequest_FieldNumber) {
RMTStreamingInputCallRequest_FieldNumber_Payload = 1,
};
// Client-streaming request.
@interface RMTStreamingInputCallRequest : GPBMessage
// Optional input payload sent along with the request.
@property(nonatomic, readwrite) BOOL hasPayload;
@property(nonatomic, readwrite, strong) RMTPayload *payload;
@end
#pragma mark - RMTStreamingInputCallResponse
typedef GPB_ENUM(RMTStreamingInputCallResponse_FieldNumber) {
RMTStreamingInputCallResponse_FieldNumber_AggregatedPayloadSize = 1,
};
// Client-streaming response.
@interface RMTStreamingInputCallResponse : GPBMessage
// Aggregated size of payloads received from the client.
@property(nonatomic, readwrite) int32_t aggregatedPayloadSize;
@end
#pragma mark - RMTResponseParameters
typedef GPB_ENUM(RMTResponseParameters_FieldNumber) {
RMTResponseParameters_FieldNumber_Size = 1,
RMTResponseParameters_FieldNumber_IntervalUs = 2,
};
// Configuration for a particular response.
@interface RMTResponseParameters : GPBMessage
// Desired payload sizes in responses from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression.
@property(nonatomic, readwrite) int32_t size;
// Desired interval between consecutive responses in the response stream in
// microseconds.
@property(nonatomic, readwrite) int32_t intervalUs;
@end
#pragma mark - RMTStreamingOutputCallRequest
typedef GPB_ENUM(RMTStreamingOutputCallRequest_FieldNumber) {
RMTStreamingOutputCallRequest_FieldNumber_ResponseType = 1,
RMTStreamingOutputCallRequest_FieldNumber_ResponseParametersArray = 2,
RMTStreamingOutputCallRequest_FieldNumber_Payload = 3,
};
// Server-streaming request.
@interface RMTStreamingOutputCallRequest : GPBMessage
// Desired payload type in the response from the server.
// If response_type is RANDOM, the payload from each response in the stream
// might be of different types. This is to simulate a mixed type of payload
// stream.
@property(nonatomic, readwrite) RMTPayloadType responseType;
// Configuration for each expected response message.
// |responseParametersArray| contains |RMTResponseParameters|
@property(nonatomic, readwrite, strong) NSMutableArray *responseParametersArray;
// Optional input payload sent along with the request.
@property(nonatomic, readwrite) BOOL hasPayload;
@property(nonatomic, readwrite, strong) RMTPayload *payload;
@end
int32_t RMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message);
void SetRMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message, int32_t value);
#pragma mark - RMTStreamingOutputCallResponse
typedef GPB_ENUM(RMTStreamingOutputCallResponse_FieldNumber) {
RMTStreamingOutputCallResponse_FieldNumber_Payload = 1,
};
// Server-streaming response, as configured by the request and parameters.
@interface RMTStreamingOutputCallResponse : GPBMessage
// Payload to increase response size.
@property(nonatomic, readwrite) BOOL hasPayload;
@property(nonatomic, readwrite, strong) RMTPayload *payload;
@end
CF_EXTERN_C_END

@ -1,603 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: messages.proto
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "Messages.pbobjc.h"
#pragma mark - RMTMessagesRoot
@implementation RMTMessagesRoot
@end
static GPBFileDescriptor *RMTMessagesRoot_FileDescriptor(void) {
// This is called by +initialize so there is no need to worry
// about thread safety of the singleton.
static GPBFileDescriptor *descriptor = NULL;
if (!descriptor) {
descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.testing"
syntax:GPBFileSyntaxProto3];
}
return descriptor;
}
#pragma mark - Enum RMTPayloadType
GPBEnumDescriptor *RMTPayloadType_EnumDescriptor(void) {
static GPBEnumDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageEnumValueDescription values[] = {
{ .name = "Compressable", .number = RMTPayloadType_Compressable },
{ .name = "Uncompressable", .number = RMTPayloadType_Uncompressable },
{ .name = "Random", .number = RMTPayloadType_Random },
};
descriptor = [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(RMTPayloadType)
values:values
valueCount:sizeof(values) / sizeof(GPBMessageEnumValueDescription)
enumVerifier:RMTPayloadType_IsValidValue];
}
return descriptor;
}
BOOL RMTPayloadType_IsValidValue(int32_t value__) {
switch (value__) {
case RMTPayloadType_Compressable:
case RMTPayloadType_Uncompressable:
case RMTPayloadType_Random:
return YES;
default:
return NO;
}
}
#pragma mark - RMTPayload
@implementation RMTPayload
@dynamic type;
@dynamic body;
typedef struct RMTPayload_Storage {
uint32_t _has_storage_[1];
RMTPayloadType type;
NSData *body;
} RMTPayload_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "type",
.number = RMTPayload_FieldNumber_Type,
.hasIndex = 0,
.flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
.type = GPBTypeEnum,
.offset = offsetof(RMTPayload_Storage, type),
.defaultValue.valueEnum = RMTPayloadType_Compressable,
.typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor,
.fieldOptions = NULL,
},
{
.name = "body",
.number = RMTPayload_FieldNumber_Body,
.hasIndex = 1,
.flags = GPBFieldOptional,
.type = GPBTypeData,
.offset = offsetof(RMTPayload_Storage, body),
.defaultValue.valueData = nil,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RMTPayload class]
rootClass:[RMTMessagesRoot class]
file:RMTMessagesRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RMTPayload_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
int32_t RMTPayload_Type_RawValue(RMTPayload *message) {
GPBDescriptor *descriptor = [RMTPayload descriptor];
GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTPayload_FieldNumber_Type];
return GPBGetInt32IvarWithField(message, field);
}
void SetRMTPayload_Type_RawValue(RMTPayload *message, int32_t value) {
GPBDescriptor *descriptor = [RMTPayload descriptor];
GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTPayload_FieldNumber_Type];
GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
}
#pragma mark - RMTSimpleRequest
@implementation RMTSimpleRequest
@dynamic responseType;
@dynamic responseSize;
@dynamic hasPayload, payload;
@dynamic fillUsername;
@dynamic fillOauthScope;
typedef struct RMTSimpleRequest_Storage {
uint32_t _has_storage_[1];
BOOL fillUsername;
BOOL fillOauthScope;
RMTPayloadType responseType;
int32_t responseSize;
RMTPayload *payload;
} RMTSimpleRequest_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "responseType",
.number = RMTSimpleRequest_FieldNumber_ResponseType,
.hasIndex = 0,
.flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
.type = GPBTypeEnum,
.offset = offsetof(RMTSimpleRequest_Storage, responseType),
.defaultValue.valueEnum = RMTPayloadType_Compressable,
.typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor,
.fieldOptions = NULL,
},
{
.name = "responseSize",
.number = RMTSimpleRequest_FieldNumber_ResponseSize,
.hasIndex = 1,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RMTSimpleRequest_Storage, responseSize),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "payload",
.number = RMTSimpleRequest_FieldNumber_Payload,
.hasIndex = 2,
.flags = GPBFieldOptional,
.type = GPBTypeMessage,
.offset = offsetof(RMTSimpleRequest_Storage, payload),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RMTPayload),
.fieldOptions = NULL,
},
{
.name = "fillUsername",
.number = RMTSimpleRequest_FieldNumber_FillUsername,
.hasIndex = 3,
.flags = GPBFieldOptional,
.type = GPBTypeBool,
.offset = offsetof(RMTSimpleRequest_Storage, fillUsername),
.defaultValue.valueBool = NO,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "fillOauthScope",
.number = RMTSimpleRequest_FieldNumber_FillOauthScope,
.hasIndex = 4,
.flags = GPBFieldOptional,
.type = GPBTypeBool,
.offset = offsetof(RMTSimpleRequest_Storage, fillOauthScope),
.defaultValue.valueBool = NO,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RMTSimpleRequest class]
rootClass:[RMTMessagesRoot class]
file:RMTMessagesRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RMTSimpleRequest_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
int32_t RMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message) {
GPBDescriptor *descriptor = [RMTSimpleRequest descriptor];
GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTSimpleRequest_FieldNumber_ResponseType];
return GPBGetInt32IvarWithField(message, field);
}
void SetRMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message, int32_t value) {
GPBDescriptor *descriptor = [RMTSimpleRequest descriptor];
GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTSimpleRequest_FieldNumber_ResponseType];
GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
}
#pragma mark - RMTSimpleResponse
@implementation RMTSimpleResponse
@dynamic hasPayload, payload;
@dynamic username;
@dynamic oauthScope;
typedef struct RMTSimpleResponse_Storage {
uint32_t _has_storage_[1];
RMTPayload *payload;
NSString *username;
NSString *oauthScope;
} RMTSimpleResponse_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "payload",
.number = RMTSimpleResponse_FieldNumber_Payload,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeMessage,
.offset = offsetof(RMTSimpleResponse_Storage, payload),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RMTPayload),
.fieldOptions = NULL,
},
{
.name = "username",
.number = RMTSimpleResponse_FieldNumber_Username,
.hasIndex = 1,
.flags = GPBFieldOptional,
.type = GPBTypeString,
.offset = offsetof(RMTSimpleResponse_Storage, username),
.defaultValue.valueString = nil,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "oauthScope",
.number = RMTSimpleResponse_FieldNumber_OauthScope,
.hasIndex = 2,
.flags = GPBFieldOptional,
.type = GPBTypeString,
.offset = offsetof(RMTSimpleResponse_Storage, oauthScope),
.defaultValue.valueString = nil,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RMTSimpleResponse class]
rootClass:[RMTMessagesRoot class]
file:RMTMessagesRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RMTSimpleResponse_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
#pragma mark - RMTStreamingInputCallRequest
@implementation RMTStreamingInputCallRequest
@dynamic hasPayload, payload;
typedef struct RMTStreamingInputCallRequest_Storage {
uint32_t _has_storage_[1];
RMTPayload *payload;
} RMTStreamingInputCallRequest_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "payload",
.number = RMTStreamingInputCallRequest_FieldNumber_Payload,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeMessage,
.offset = offsetof(RMTStreamingInputCallRequest_Storage, payload),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RMTPayload),
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingInputCallRequest class]
rootClass:[RMTMessagesRoot class]
file:RMTMessagesRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RMTStreamingInputCallRequest_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
#pragma mark - RMTStreamingInputCallResponse
@implementation RMTStreamingInputCallResponse
@dynamic aggregatedPayloadSize;
typedef struct RMTStreamingInputCallResponse_Storage {
uint32_t _has_storage_[1];
int32_t aggregatedPayloadSize;
} RMTStreamingInputCallResponse_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "aggregatedPayloadSize",
.number = RMTStreamingInputCallResponse_FieldNumber_AggregatedPayloadSize,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RMTStreamingInputCallResponse_Storage, aggregatedPayloadSize),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingInputCallResponse class]
rootClass:[RMTMessagesRoot class]
file:RMTMessagesRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RMTStreamingInputCallResponse_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
#pragma mark - RMTResponseParameters
@implementation RMTResponseParameters
@dynamic size;
@dynamic intervalUs;
typedef struct RMTResponseParameters_Storage {
uint32_t _has_storage_[1];
int32_t size;
int32_t intervalUs;
} RMTResponseParameters_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "size",
.number = RMTResponseParameters_FieldNumber_Size,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RMTResponseParameters_Storage, size),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "intervalUs",
.number = RMTResponseParameters_FieldNumber_IntervalUs,
.hasIndex = 1,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RMTResponseParameters_Storage, intervalUs),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RMTResponseParameters class]
rootClass:[RMTMessagesRoot class]
file:RMTMessagesRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RMTResponseParameters_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
#pragma mark - RMTStreamingOutputCallRequest
@implementation RMTStreamingOutputCallRequest
@dynamic responseType;
@dynamic responseParametersArray;
@dynamic hasPayload, payload;
typedef struct RMTStreamingOutputCallRequest_Storage {
uint32_t _has_storage_[1];
RMTPayloadType responseType;
NSMutableArray *responseParametersArray;
RMTPayload *payload;
} RMTStreamingOutputCallRequest_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "responseType",
.number = RMTStreamingOutputCallRequest_FieldNumber_ResponseType,
.hasIndex = 0,
.flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
.type = GPBTypeEnum,
.offset = offsetof(RMTStreamingOutputCallRequest_Storage, responseType),
.defaultValue.valueEnum = RMTPayloadType_Compressable,
.typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor,
.fieldOptions = NULL,
},
{
.name = "responseParametersArray",
.number = RMTStreamingOutputCallRequest_FieldNumber_ResponseParametersArray,
.hasIndex = GPBNoHasBit,
.flags = GPBFieldRepeated,
.type = GPBTypeMessage,
.offset = offsetof(RMTStreamingOutputCallRequest_Storage, responseParametersArray),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RMTResponseParameters),
.fieldOptions = NULL,
},
{
.name = "payload",
.number = RMTStreamingOutputCallRequest_FieldNumber_Payload,
.hasIndex = 2,
.flags = GPBFieldOptional,
.type = GPBTypeMessage,
.offset = offsetof(RMTStreamingOutputCallRequest_Storage, payload),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RMTPayload),
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingOutputCallRequest class]
rootClass:[RMTMessagesRoot class]
file:RMTMessagesRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RMTStreamingOutputCallRequest_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
int32_t RMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message) {
GPBDescriptor *descriptor = [RMTStreamingOutputCallRequest descriptor];
GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTStreamingOutputCallRequest_FieldNumber_ResponseType];
return GPBGetInt32IvarWithField(message, field);
}
void SetRMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message, int32_t value) {
GPBDescriptor *descriptor = [RMTStreamingOutputCallRequest descriptor];
GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTStreamingOutputCallRequest_FieldNumber_ResponseType];
GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
}
#pragma mark - RMTStreamingOutputCallResponse
@implementation RMTStreamingOutputCallResponse
@dynamic hasPayload, payload;
typedef struct RMTStreamingOutputCallResponse_Storage {
uint32_t _has_storage_[1];
RMTPayload *payload;
} RMTStreamingOutputCallResponse_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "payload",
.number = RMTStreamingOutputCallResponse_FieldNumber_Payload,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeMessage,
.offset = offsetof(RMTStreamingOutputCallResponse_Storage, payload),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RMTPayload),
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingOutputCallResponse class]
rootClass:[RMTMessagesRoot class]
file:RMTMessagesRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RMTStreamingOutputCallResponse_Storage)
wireFormat:NO];
}
return descriptor;
}
@end

@ -1,24 +1,26 @@
Pod::Spec.new do |s|
s.name = 'RemoteTest'
s.version = '0.0.1'
s.summary = 'Protobuf library generated from test.proto, messages.proto, and empty.proto'
s.homepage = 'https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample/RemoteTestClient'
s.license = 'New BSD'
s.authors = { 'Jorge Canizales' => 'jcanizales@google.com' }
s.name = "RemoteTest"
s.version = "0.0.1"
s.license = "New BSD"
s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
s.ios.deployment_target = "6.0"
s.osx.deployment_target = "10.8"
s.subspec 'Messages' do |ms|
ms.source_files = '*.pbobjc.{h,m}'
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
s.prepare_command = "protoc --objc_out=. --objcgrpc_out=. *.proto **/*.proto"
s.subspec "Messages" do |ms|
ms.source_files = "*.pbobjc.{h,m}", "**/*.pbobjc.{h,m}"
ms.header_mappings_dir = "."
ms.requires_arc = false
ms.dependency 'Protobuf', '~> 3.0'
ms.dependency "Protobuf", "~> 3.0.0-alpha-3"
end
s.subspec 'Services' do |ss|
ss.source_files = '*.pbrpc.{h,m}'
s.subspec "Services" do |ss|
ss.source_files = "*.pbrpc.{h,m}", "**/*.pbrpc.{h,m}"
ss.header_mappings_dir = "."
ss.requires_arc = true
ss.dependency 'gRPC', '~> 0.0'
ss.dependency 'RemoteTest/Messages'
ss.dependency "gRPC", "~> 0.5"
ss.dependency "#{s.name}/Messages"
end
end

@ -1,12 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: test.proto
#import "GPBProtocolBuffers.h"
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
#endif
CF_EXTERN_C_BEGIN
CF_EXTERN_C_END

@ -1,9 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: test.proto
// File empty because all messages, extensions and enum have been filtered.
// Dummy symbol that will be stripped but will avoid linker warnings about
// no symbols in the .o form compiling this file.
static int RMTTestRoot_dummy __attribute__((unused,used)) = 0;

@ -1,59 +0,0 @@
#import "Test.pbobjc.h"
#import <gRPC/ProtoService.h>
#import "Empty.pbobjc.h"
#import "Messages.pbobjc.h"
@protocol GRXWriteable;
@protocol GRXWriter;
@protocol RMTTestService <NSObject>
#pragma mark EmptyCall(Empty) returns (Empty)
- (void)emptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler;
- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler;
#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse)
- (void)unaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler;
- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler;
#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse)
- (void)streamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler;
- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler;
#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
- (void)fullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
- (void)halfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
@end
// Basic service implementation, over gRPC, that only does marshalling and parsing.
@interface RMTTestService : ProtoService<RMTTestService>
- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER;
@end

@ -1,96 +0,0 @@
#import "Test.pbrpc.h"
#import <gRPC/GRXWriteable.h>
#import <gRPC/GRXWriter+Immediate.h>
#import <gRPC/ProtoRPC.h>
static NSString *const kPackageName = @"grpc.testing";
static NSString *const kServiceName = @"TestService";
@implementation RMTTestService
// Designated initializer
- (instancetype)initWithHost:(NSString *)host {
return (self = [super initWithHost:host packageName:kPackageName serviceName:kServiceName]);
}
// Override superclass initializer to disallow different package and service names.
- (instancetype)initWithHost:(NSString *)host
packageName:(NSString *)packageName
serviceName:(NSString *)serviceName {
return [self initWithHost:host];
}
#pragma mark EmptyCall(Empty) returns (Empty)
- (void)emptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler{
[[self RPCToEmptyCallWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler{
return [self RPCToMethod:@"EmptyCall"
requestsWriter:[GRXWriter writerWithValue:request]
responseClass:[RMTEmpty class]
responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
}
#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse)
- (void)unaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler{
[[self RPCToUnaryCallWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler{
return [self RPCToMethod:@"UnaryCall"
requestsWriter:[GRXWriter writerWithValue:request]
responseClass:[RMTSimpleResponse class]
responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
}
#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
[[self RPCToStreamingOutputCallWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
return [self RPCToMethod:@"StreamingOutputCall"
requestsWriter:[GRXWriter writerWithValue:request]
responseClass:[RMTStreamingOutputCallResponse class]
responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
}
#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse)
- (void)streamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler{
[[self RPCToStreamingInputCallWithRequestsWriter:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler{
return [self RPCToMethod:@"StreamingInputCall"
requestsWriter:request
responseClass:[RMTStreamingInputCallResponse class]
responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
}
#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
- (void)fullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
[[self RPCToFullDuplexCallWithRequestsWriter:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
return [self RPCToMethod:@"FullDuplexCall"
requestsWriter:request
responseClass:[RMTStreamingOutputCallResponse class]
responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
}
#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
- (void)halfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
[[self RPCToHalfDuplexCallWithRequestsWriter:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
return [self RPCToMethod:@"HalfDuplexCall"
requestsWriter:request
responseClass:[RMTStreamingOutputCallResponse class]
responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
}
@end

@ -1,134 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
#import "GPBProtocolBuffers.h"
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
#endif
CF_EXTERN_C_BEGIN
@class RGDFeature;
@class RGDPoint;
@class RGDRectangle;
@class RGDRouteNote;
@class RGDRouteSummary;
#pragma mark - RGDRouteGuideRoot
@interface RGDRouteGuideRoot : GPBRootObject
@end
#pragma mark - RGDPoint
typedef GPB_ENUM(RGDPoint_FieldNumber) {
RGDPoint_FieldNumber_Latitude = 1,
RGDPoint_FieldNumber_Longitude = 2,
};
// Points are represented as latitude-longitude pairs in the E7 representation
// (degrees multiplied by 10**7 and rounded to the nearest integer).
// Latitudes should be in the range +/- 90 degrees and longitude should be in
// the range +/- 180 degrees (inclusive).
@interface RGDPoint : GPBMessage
@property(nonatomic, readwrite) int32_t latitude;
@property(nonatomic, readwrite) int32_t longitude;
@end
#pragma mark - RGDRectangle
typedef GPB_ENUM(RGDRectangle_FieldNumber) {
RGDRectangle_FieldNumber_Lo = 1,
RGDRectangle_FieldNumber_Hi = 2,
};
// A latitude-longitude rectangle, represented as two diagonally opposite
// points "lo" and "hi".
@interface RGDRectangle : GPBMessage
// One corner of the rectangle.
@property(nonatomic, readwrite) BOOL hasLo;
@property(nonatomic, readwrite, strong) RGDPoint *lo;
// The other corner of the rectangle.
@property(nonatomic, readwrite) BOOL hasHi;
@property(nonatomic, readwrite, strong) RGDPoint *hi;
@end
#pragma mark - RGDFeature
typedef GPB_ENUM(RGDFeature_FieldNumber) {
RGDFeature_FieldNumber_Name = 1,
RGDFeature_FieldNumber_Location = 2,
};
// A feature names something at a given point.
//
// If a feature could not be named, the name is empty.
@interface RGDFeature : GPBMessage
// The name of the feature.
@property(nonatomic, readwrite, copy) NSString *name;
// The point where the feature is detected.
@property(nonatomic, readwrite) BOOL hasLocation;
@property(nonatomic, readwrite, strong) RGDPoint *location;
@end
#pragma mark - RGDRouteNote
typedef GPB_ENUM(RGDRouteNote_FieldNumber) {
RGDRouteNote_FieldNumber_Location = 1,
RGDRouteNote_FieldNumber_Message = 2,
};
// A RouteNote is a message sent while at a given point.
@interface RGDRouteNote : GPBMessage
// The location from which the message is sent.
@property(nonatomic, readwrite) BOOL hasLocation;
@property(nonatomic, readwrite, strong) RGDPoint *location;
// The message to be sent.
@property(nonatomic, readwrite, copy) NSString *message;
@end
#pragma mark - RGDRouteSummary
typedef GPB_ENUM(RGDRouteSummary_FieldNumber) {
RGDRouteSummary_FieldNumber_PointCount = 1,
RGDRouteSummary_FieldNumber_FeatureCount = 2,
RGDRouteSummary_FieldNumber_Distance = 3,
RGDRouteSummary_FieldNumber_ElapsedTime = 4,
};
// A RouteSummary is received in response to a RecordRoute rpc.
//
// It contains the number of individual points received, the number of
// detected features, and the total distance covered as the cumulative sum of
// the distance between each point.
@interface RGDRouteSummary : GPBMessage
// The number of points received.
@property(nonatomic, readwrite) int32_t pointCount;
// The number of known features passed while traversing the route.
@property(nonatomic, readwrite) int32_t featureCount;
// The distance covered in metres.
@property(nonatomic, readwrite) int32_t distance;
// The duration of the traversal in seconds.
@property(nonatomic, readwrite) int32_t elapsedTime;
@end
CF_EXTERN_C_END

@ -1,355 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "RouteGuide.pbobjc.h"
#pragma mark - RGDRouteGuideRoot
@implementation RGDRouteGuideRoot
@end
static GPBFileDescriptor *RGDRouteGuideRoot_FileDescriptor(void) {
// This is called by +initialize so there is no need to worry
// about thread safety of the singleton.
static GPBFileDescriptor *descriptor = NULL;
if (!descriptor) {
descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.example.routeguide"
syntax:GPBFileSyntaxProto3];
}
return descriptor;
}
#pragma mark - RGDPoint
@implementation RGDPoint
@dynamic latitude;
@dynamic longitude;
typedef struct RGDPoint_Storage {
uint32_t _has_storage_[1];
int32_t latitude;
int32_t longitude;
} RGDPoint_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "latitude",
.number = RGDPoint_FieldNumber_Latitude,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RGDPoint_Storage, latitude),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "longitude",
.number = RGDPoint_FieldNumber_Longitude,
.hasIndex = 1,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RGDPoint_Storage, longitude),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RGDPoint class]
rootClass:[RGDRouteGuideRoot class]
file:RGDRouteGuideRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RGDPoint_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
#pragma mark - RGDRectangle
@implementation RGDRectangle
@dynamic hasLo, lo;
@dynamic hasHi, hi;
typedef struct RGDRectangle_Storage {
uint32_t _has_storage_[1];
RGDPoint *lo;
RGDPoint *hi;
} RGDRectangle_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "lo",
.number = RGDRectangle_FieldNumber_Lo,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeMessage,
.offset = offsetof(RGDRectangle_Storage, lo),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RGDPoint),
.fieldOptions = NULL,
},
{
.name = "hi",
.number = RGDRectangle_FieldNumber_Hi,
.hasIndex = 1,
.flags = GPBFieldOptional,
.type = GPBTypeMessage,
.offset = offsetof(RGDRectangle_Storage, hi),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RGDPoint),
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RGDRectangle class]
rootClass:[RGDRouteGuideRoot class]
file:RGDRouteGuideRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RGDRectangle_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
#pragma mark - RGDFeature
@implementation RGDFeature
@dynamic name;
@dynamic hasLocation, location;
typedef struct RGDFeature_Storage {
uint32_t _has_storage_[1];
NSString *name;
RGDPoint *location;
} RGDFeature_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "name",
.number = RGDFeature_FieldNumber_Name,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeString,
.offset = offsetof(RGDFeature_Storage, name),
.defaultValue.valueString = nil,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "location",
.number = RGDFeature_FieldNumber_Location,
.hasIndex = 1,
.flags = GPBFieldOptional,
.type = GPBTypeMessage,
.offset = offsetof(RGDFeature_Storage, location),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RGDPoint),
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RGDFeature class]
rootClass:[RGDRouteGuideRoot class]
file:RGDRouteGuideRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RGDFeature_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
#pragma mark - RGDRouteNote
@implementation RGDRouteNote
@dynamic hasLocation, location;
@dynamic message;
typedef struct RGDRouteNote_Storage {
uint32_t _has_storage_[1];
RGDPoint *location;
NSString *message;
} RGDRouteNote_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "location",
.number = RGDRouteNote_FieldNumber_Location,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeMessage,
.offset = offsetof(RGDRouteNote_Storage, location),
.defaultValue.valueMessage = nil,
.typeSpecific.className = GPBStringifySymbol(RGDPoint),
.fieldOptions = NULL,
},
{
.name = "message",
.number = RGDRouteNote_FieldNumber_Message,
.hasIndex = 1,
.flags = GPBFieldOptional,
.type = GPBTypeString,
.offset = offsetof(RGDRouteNote_Storage, message),
.defaultValue.valueString = nil,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RGDRouteNote class]
rootClass:[RGDRouteGuideRoot class]
file:RGDRouteGuideRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RGDRouteNote_Storage)
wireFormat:NO];
}
return descriptor;
}
@end
#pragma mark - RGDRouteSummary
@implementation RGDRouteSummary
@dynamic pointCount;
@dynamic featureCount;
@dynamic distance;
@dynamic elapsedTime;
typedef struct RGDRouteSummary_Storage {
uint32_t _has_storage_[1];
int32_t pointCount;
int32_t featureCount;
int32_t distance;
int32_t elapsedTime;
} RGDRouteSummary_Storage;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = NULL;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "pointCount",
.number = RGDRouteSummary_FieldNumber_PointCount,
.hasIndex = 0,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RGDRouteSummary_Storage, pointCount),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "featureCount",
.number = RGDRouteSummary_FieldNumber_FeatureCount,
.hasIndex = 1,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RGDRouteSummary_Storage, featureCount),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "distance",
.number = RGDRouteSummary_FieldNumber_Distance,
.hasIndex = 2,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RGDRouteSummary_Storage, distance),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
{
.name = "elapsedTime",
.number = RGDRouteSummary_FieldNumber_ElapsedTime,
.hasIndex = 3,
.flags = GPBFieldOptional,
.type = GPBTypeInt32,
.offset = offsetof(RGDRouteSummary_Storage, elapsedTime),
.defaultValue.valueInt32 = 0,
.typeSpecific.className = NULL,
.fieldOptions = NULL,
},
};
descriptor = [GPBDescriptor allocDescriptorForClass:[RGDRouteSummary class]
rootClass:[RGDRouteGuideRoot class]
file:RGDRouteGuideRoot_FileDescriptor()
fields:fields
fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
oneofs:NULL
oneofCount:0
enums:NULL
enumCount:0
ranges:NULL
rangeCount:0
storageSize:sizeof(RGDRouteSummary_Storage)
wireFormat:NO];
}
return descriptor;
}
@end

@ -1,43 +0,0 @@
#import "RouteGuide.pbobjc.h"
#import <gRPC/ProtoService.h>
@protocol GRXWriteable;
@protocol GRXWriter;
@protocol RGDRouteGuide <NSObject>
#pragma mark GetFeature(Point) returns (Feature)
- (void)getFeatureWithRequest:(RGDPoint *)request handler:(void(^)(RGDFeature *response, NSError *error))handler;
- (ProtoRPC *)RPCToGetFeatureWithRequest:(RGDPoint *)request handler:(void(^)(RGDFeature *response, NSError *error))handler;
#pragma mark ListFeatures(Rectangle) returns (stream Feature)
- (void)listFeaturesWithRequest:(RGDRectangle *)request handler:(void(^)(BOOL done, RGDFeature *response, NSError *error))handler;
- (ProtoRPC *)RPCToListFeaturesWithRequest:(RGDRectangle *)request handler:(void(^)(BOOL done, RGDFeature *response, NSError *error))handler;
#pragma mark RecordRoute(stream Point) returns (RouteSummary)
- (void)recordRouteWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RGDRouteSummary *response, NSError *error))handler;
- (ProtoRPC *)RPCToRecordRouteWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RGDRouteSummary *response, NSError *error))handler;
#pragma mark RouteChat(stream RouteNote) returns (stream RouteNote)
- (void)routeChatWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RGDRouteNote *response, NSError *error))handler;
- (ProtoRPC *)RPCToRouteChatWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RGDRouteNote *response, NSError *error))handler;
@end
// Basic service implementation, over gRPC, that only does marshalling and parsing.
@interface RGDRouteGuide : ProtoService<RGDRouteGuide>
- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER;
@end

@ -1,72 +0,0 @@
#import "RouteGuide.pbrpc.h"
#import <gRPC/GRXWriteable.h>
#import <gRPC/GRXWriter+Immediate.h>
#import <gRPC/ProtoRPC.h>
static NSString *const kPackageName = @"grpc.example.routeguide";
static NSString *const kServiceName = @"RouteGuide";
@implementation RGDRouteGuide
// Designated initializer
- (instancetype)initWithHost:(NSString *)host {
return (self = [super initWithHost:host packageName:kPackageName serviceName:kServiceName]);
}
// Override superclass initializer to disallow different package and service names.
- (instancetype)initWithHost:(NSString *)host
packageName:(NSString *)packageName
serviceName:(NSString *)serviceName {
return [self initWithHost:host];
}
#pragma mark GetFeature(Point) returns (Feature)
- (void)getFeatureWithRequest:(RGDPoint *)request handler:(void(^)(RGDFeature *response, NSError *error))handler{
[[self RPCToGetFeatureWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToGetFeatureWithRequest:(RGDPoint *)request handler:(void(^)(RGDFeature *response, NSError *error))handler{
return [self RPCToMethod:@"GetFeature"
requestsWriter:[GRXWriter writerWithValue:request]
responseClass:[RGDFeature class]
responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
}
#pragma mark ListFeatures(Rectangle) returns (stream Feature)
- (void)listFeaturesWithRequest:(RGDRectangle *)request handler:(void(^)(BOOL done, RGDFeature *response, NSError *error))handler{
[[self RPCToListFeaturesWithRequest:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToListFeaturesWithRequest:(RGDRectangle *)request handler:(void(^)(BOOL done, RGDFeature *response, NSError *error))handler{
return [self RPCToMethod:@"ListFeatures"
requestsWriter:[GRXWriter writerWithValue:request]
responseClass:[RGDFeature class]
responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
}
#pragma mark RecordRoute(stream Point) returns (RouteSummary)
- (void)recordRouteWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RGDRouteSummary *response, NSError *error))handler{
[[self RPCToRecordRouteWithRequestsWriter:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToRecordRouteWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RGDRouteSummary *response, NSError *error))handler{
return [self RPCToMethod:@"RecordRoute"
requestsWriter:request
responseClass:[RGDRouteSummary class]
responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
}
#pragma mark RouteChat(stream RouteNote) returns (stream RouteNote)
- (void)routeChatWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RGDRouteNote *response, NSError *error))handler{
[[self RPCToRouteChatWithRequestsWriter:request handler:handler] start];
}
// Returns a not-yet-started RPC object.
- (ProtoRPC *)RPCToRouteChatWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RGDRouteNote *response, NSError *error))handler{
return [self RPCToMethod:@"RouteChat"
requestsWriter:request
responseClass:[RGDRouteNote class]
responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
}
@end

@ -0,0 +1,26 @@
Pod::Spec.new do |s|
s.name = "RouteGuide"
s.version = "0.0.1"
s.license = "New BSD"
s.ios.deployment_target = "6.0"
s.osx.deployment_target = "10.8"
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
s.prepare_command = "protoc --objc_out=. --objcgrpc_out=. *.proto **/*.proto"
s.subspec "Messages" do |ms|
ms.source_files = "*.pbobjc.{h,m}", "**/*.pbobjc.{h,m}"
ms.header_mappings_dir = "."
ms.requires_arc = false
ms.dependency "Protobuf", "~> 3.0.0-alpha-3"
end
s.subspec "Services" do |ss|
ss.source_files = "*.pbrpc.{h,m}", "**/*.pbrpc.{h,m}"
ss.header_mappings_dir = "."
ss.requires_arc = true
ss.dependency "gRPC", "~> 0.5"
ss.dependency "#{s.name}/Messages"
end
end

@ -1,24 +0,0 @@
Pod::Spec.new do |s|
s.name = 'Route_guide'
s.version = '0.0.1'
s.summary = 'Protobuf library generated from route_guide.proto'
s.homepage = 'https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample/RouteGuideClient'
s.license = 'New BSD'
s.authors = { 'Jorge Canizales' => 'jcanizales@google.com' }
s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
s.subspec 'Messages' do |ms|
ms.source_files = '*.pbobjc.{h,m}'
ms.requires_arc = false
ms.dependency 'Protobuf', '~> 3.0'
end
s.subspec 'Services' do |ss|
ss.source_files = '*.pbrpc.{h,m}'
ss.requires_arc = true
ss.dependency 'gRPC', '~> 0.0'
ss.dependency 'Route_guide/Messages'
end
end

@ -29,7 +29,7 @@
syntax = "proto3";
package grpc.example.routeguide;
package examples;
option objc_class_prefix = "RGD";

@ -38,56 +38,62 @@
#import <gRPC/GRPCMethodName.h>
#import <gRPC/GRXWriter+Immediate.h>
#import <gRPC/GRXWriteable.h>
#import <Route_guide/RouteGuide.pbobjc.h>
#import <Route_guide/RouteGuide.pbrpc.h>
#import <RouteGuide/RouteGuide.pbobjc.h>
#import <RouteGuide/RouteGuide.pbrpc.h>
// These tests require the gRPC-Java "RouteGuide" sample server to be running locally. To do so,
// install Gradle by following the instructions here: https://docs.gradle.org/current/userguide/installation.html
// And use it to run the server by following the instructions here: https://github.com/grpc/grpc-java/tree/master/examples
// These tests require a gRPC "RouteGuide" sample server to be running locally. You can compile and
// run one by following the instructions here: https://github.com/grpc/grpc-common/blob/master/cpp/cpptutorial.md#try-it-out
// Be sure to have the C gRPC library installed in your system (for example, by having followed the
// instructions at https://github.com/grpc/homebrew-grpc
static NSString * const kRouteGuideHost = @"http://localhost:50051";
static NSString * const kPackage = @"examples";
static NSString * const kService = @"RouteGuide";
@interface LocalClearTextTests : XCTestCase
@end
@implementation LocalClearTextTests
- (void)testConnectionToLocalServer {
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"Server reachable."];
// This method isn't implemented by the local server.
GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.testing"
interface:@"TestService"
method:@"EmptyCall"];
id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[NSData data]];
GRPCCall *call = [[GRPCCall alloc] initWithHost:@"http://127.0.0.1:8980"
method:method
requestsWriter:requestsWriter];
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
XCTFail(@"Received unexpected response: %@", value);
} completionHandler:^(NSError *errorOrNil) {
XCTAssertNotNil(errorOrNil, @"Finished without error!");
XCTAssertEqual(errorOrNil.code, 12, @"Finished with unexpected error: %@", errorOrNil);
[expectation fulfill];
}];
[call startWithWriteable:responsesWriteable];
[self waitForExpectationsWithTimeout:2.0 handler:nil];
}
// This test currently fails: see Issue #1907.
//- (void)testConnectionToLocalServer {
// __weak XCTestExpectation *expectation = [self expectationWithDescription:@"Server reachable."];
//
// // This method isn't implemented by the local server.
// GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage
// interface:kService
// method:@"EmptyCall"];
//
// id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[NSData data]];
//
// GRPCCall *call = [[GRPCCall alloc] initWithHost:kRouteGuideHost
// method:method
// requestsWriter:requestsWriter];
//
// id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
// XCTFail(@"Received unexpected response: %@", value);
// } completionHandler:^(NSError *errorOrNil) {
// XCTAssertNotNil(errorOrNil, @"Finished without error!");
// XCTAssertEqual(errorOrNil.code, 12, @"Finished with unexpected error: %@", errorOrNil);
// [expectation fulfill];
// }];
//
// [call startWithWriteable:responsesWriteable];
//
// [self waitForExpectationsWithTimeout:8.0 handler:nil];
//}
- (void)testEmptyRPC {
__weak XCTestExpectation *response = [self expectationWithDescription:@"Empty response received."];
__weak XCTestExpectation *completion = [self expectationWithDescription:@"Empty RPC completed."];
GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.example.routeguide"
interface:@"RouteGuide"
GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage
interface:kService
method:@"RecordRoute"];
id<GRXWriter> requestsWriter = [GRXWriter emptyWriter];
GRPCCall *call = [[GRPCCall alloc] initWithHost:@"http://127.0.0.1:8980"
GRPCCall *call = [[GRPCCall alloc] initWithHost:kRouteGuideHost
method:method
requestsWriter:requestsWriter];
@ -109,8 +115,8 @@
__weak XCTestExpectation *response = [self expectationWithDescription:@"Response received."];
__weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."];
GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.example.routeguide"
interface:@"RouteGuide"
GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage
interface:kService
method:@"GetFeature"];
RGDPoint *point = [RGDPoint message];
@ -118,7 +124,7 @@
point.longitude = -15E7;
id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[point data]];
GRPCCall *call = [[GRPCCall alloc] initWithHost:@"http://127.0.0.1:8980"
GRPCCall *call = [[GRPCCall alloc] initWithHost:kRouteGuideHost
method:method
requestsWriter:requestsWriter];
@ -145,7 +151,7 @@
point.latitude = 28E7;
point.longitude = -15E7;
RGDRouteGuide *service = [[RGDRouteGuide alloc] initWithHost:@"http://127.0.0.1:8980"];
RGDRouteGuide *service = [[RGDRouteGuide alloc] initWithHost:kRouteGuideHost];
[service getFeatureWithRequest:point handler:^(RGDFeature *response, NSError *error) {
XCTAssertNil(error, @"Finished with unexpected error: %@", error);
XCTAssertEqualObjects(point, response.location);

@ -2,9 +2,8 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'gRPC', :path => "../../.."
pod 'Protobuf', :git => 'https://github.com/google/protobuf.git'
pod 'RemoteTest', :path => "../generated_libraries/RemoteTestClient"
pod 'Route_guide', :path => "../generated_libraries/RouteGuideClient"
pod 'RouteGuide', :path => "../generated_libraries/RouteGuideClient"
link_with 'AllTests'

@ -32,29 +32,6 @@ require 'mkmf'
LIBDIR = RbConfig::CONFIG['libdir']
INCLUDEDIR = RbConfig::CONFIG['includedir']
if ENV.key? 'GRPC_ROOT'
GRPC_ROOT = ENV['GRPC_ROOT']
else
grpc_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
if File.exist?(File.join(grpc_root, 'include/grpc/grpc.h'))
GRPC_ROOT = grpc_root
else
GRPC_ROOT = nil
end
end
if ENV.key? 'CONFIG'
GRPC_CONFIG = ENV['CONFIG']
else
GRPC_CONFIG = 'opt'
end
if (ENV.key? 'GRPC_LIB_DIR') && (!GRPC_ROOT.nil?)
GRPC_LIB_DIR = File.join(GRPC_ROOT, ENV['GRPC_LIB_DIR'])
else
GRPC_LIB_DIR = File.join(File.join(GRPC_ROOT, 'libs'), GRPC_CONFIG)
end
HEADER_DIRS = [
# Search /opt/local (Mac source install)
'/opt/local/include',
@ -77,12 +54,26 @@ LIB_DIRS = [
LIBDIR
]
unless GRPC_ROOT.nil?
HEADER_DIRS.unshift File.join(GRPC_ROOT, 'include')
LIB_DIRS.unshift GRPC_LIB_DIR
unless File.exist?(File.join(GRPC_LIB_DIR, 'libgrpc.a'))
system("make -C #{GRPC_ROOT} static_c CONFIG=#{GRPC_CONFIG}")
# Check to see if GRPC_ROOT is defined or available
grpc_root = ENV['GRPC_ROOT']
if grpc_root.nil?
r = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
grpc_root = r if File.exist?(File.join(r, 'include/grpc/grpc.h'))
end
# When grpc_root is available attempt to build the grpc core.
unless grpc_root.nil?
grpc_config = ENV['GRPC_CONFIG'] || 'opt'
if ENV.key?('GRPC_LIB_DIR')
grpc_lib_dir = File.join(grpc_root, ENV['GRPC_LIB_DIR'])
else
grpc_lib_dir = File.join(File.join(grpc_root, 'libs'), grpc_config)
end
unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a'))
system("make -C #{grpc_root} static_c CONFIG=#{grpc_config}")
end
HEADER_DIRS.unshift File.join(grpc_root, 'include')
LIB_DIRS.unshift grpc_lib_dir
end
def crash(msg)

@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.license = 'BSD-3-Clause'
s.required_ruby_version = '>= 2.0.0'
s.requirements << 'libgrpc ~> 0.6.0 needs to be installed'
s.requirements << 'libgrpc ~> 0.9.1 needs to be installed'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- spec/*`.split("\n")

@ -29,5 +29,5 @@
# GRPC contains the General RPC module.
module GRPC
VERSION = '0.9.2'
VERSION = '0.9.3'
end

@ -77,7 +77,8 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc/ref/${packagename.lower()}
OUTPUT_DIRECTORY = doc/ref/${
packagename.lower() + ('.internal' if internal else '')}
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and

@ -38,6 +38,7 @@
#include "src/core/iomgr/endpoint_pair.h"
#include "src/core/surface/completion_queue.h"
#include "src/core/surface/server.h"
#include "src/core/support/string.h"
#include "src/core/transport/chttp2_transport.h"
#include <grpc/support/sync.h>
@ -72,17 +73,21 @@ static grpc_transport_setup_result server_setup_transport(
grpc_server_get_channel_args(a->server));
}
void grpc_run_bad_client_test(const char *name, const char *client_payload,
size_t client_payload_length,
grpc_bad_client_server_side_validator validator) {
void grpc_run_bad_client_test(grpc_bad_client_server_side_validator validator,
const char *client_payload,
size_t client_payload_length, gpr_uint32 flags) {
grpc_endpoint_pair sfd;
thd_args a;
gpr_thd_id id;
char *hex;
gpr_slice slice =
gpr_slice_from_copied_buffer(client_payload, client_payload_length);
hex =
gpr_hexdump(client_payload, client_payload_length, GPR_HEXDUMP_PLAINTEXT);
/* Add a debug log */
gpr_log(GPR_INFO, "TEST: %s", name);
gpr_log(GPR_INFO, "TEST: %s", hex);
/* Init grpc */
grpc_init();
@ -126,10 +131,18 @@ void grpc_run_bad_client_test(const char *name, const char *client_payload,
/* Await completion */
GPR_ASSERT(
gpr_event_wait(&a.done_write, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)));
if (flags & GRPC_BAD_CLIENT_DISCONNECT) {
grpc_endpoint_destroy(sfd.client);
sfd.client = NULL;
}
GPR_ASSERT(gpr_event_wait(&a.done_thd, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)));
/* Shutdown */
if (sfd.client) {
grpc_endpoint_destroy(sfd.client);
}
grpc_server_destroy(a.server);
grpc_completion_queue_destroy(a.cq);

@ -40,13 +40,18 @@
typedef void (*grpc_bad_client_server_side_validator)(
grpc_server *server, grpc_completion_queue *cq);
#define GRPC_BAD_CLIENT_DISCONNECT 1
/* Test runner.
Create a server, and send client_payload to it as bytes from a client.
Execute validator in a separate thread to assert that the bytes are
handled as expected. */
void grpc_run_bad_client_test(const char *name, const char *client_payload,
size_t client_payload_length,
grpc_bad_client_server_side_validator validator);
void grpc_run_bad_client_test(grpc_bad_client_server_side_validator validator,
const char *client_payload,
size_t client_payload_length, gpr_uint32 flags);
#define GRPC_RUN_BAD_CLIENT_TEST(validator, payload, flags) \
grpc_run_bad_client_test(validator, payload, sizeof(payload) - 1, flags)
#endif /* GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H */

@ -41,6 +41,7 @@ default_test_options = TestOptions(False)
# maps test names to options
BAD_CLIENT_TESTS = {
'connection_prefix': default_test_options,
'initial_settings_frame': default_test_options,
}
def main():

@ -36,44 +36,38 @@
static void verifier(grpc_server *server, grpc_completion_queue *cq) {
while (grpc_server_has_open_connections(server)) {
GPR_ASSERT(grpc_completion_queue_next(
cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20)).type ==
GRPC_QUEUE_TIMEOUT);
GPR_ASSERT(
grpc_completion_queue_next(cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20))
.type == GRPC_QUEUE_TIMEOUT);
}
}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_run_bad_client_test("conpfx_1", "X", 1, verifier);
grpc_run_bad_client_test("conpfx_2", "PX", 2, verifier);
grpc_run_bad_client_test("conpfx_3", "PRX", 3, verifier);
grpc_run_bad_client_test("conpfx_4", "PRIX", 4, verifier);
grpc_run_bad_client_test("conpfx_5", "PRI X", 5, verifier);
grpc_run_bad_client_test("conpfx_6", "PRI *X", 6, verifier);
grpc_run_bad_client_test("conpfx_7", "PRI * X", 7, verifier);
grpc_run_bad_client_test("conpfx_8", "PRI * HX", 8, verifier);
grpc_run_bad_client_test("conpfx_9", "PRI * HTX", 9, verifier);
grpc_run_bad_client_test("conpfx_10", "PRI * HTTX", 10, verifier);
grpc_run_bad_client_test("conpfx_11", "PRI * HTTPX", 11, verifier);
grpc_run_bad_client_test("conpfx_12", "PRI * HTTP/X", 12, verifier);
grpc_run_bad_client_test("conpfx_13", "PRI * HTTP/2X", 13, verifier);
grpc_run_bad_client_test("conpfx_14", "PRI * HTTP/2.X", 14, verifier);
grpc_run_bad_client_test("conpfx_15", "PRI * HTTP/2.0X", 15, verifier);
grpc_run_bad_client_test("conpfx_16", "PRI * HTTP/2.0\rX", 16, verifier);
grpc_run_bad_client_test("conpfx_17", "PRI * HTTP/2.0\r\nX", 17, verifier);
grpc_run_bad_client_test("conpfx_18", "PRI * HTTP/2.0\r\n\rX", 18, verifier);
grpc_run_bad_client_test("conpfx_19", "PRI * HTTP/2.0\r\n\r\nX", 19,
verifier);
grpc_run_bad_client_test("conpfx_20", "PRI * HTTP/2.0\r\n\r\nSX", 20,
verifier);
grpc_run_bad_client_test("conpfx_21", "PRI * HTTP/2.0\r\n\r\nSMX", 21,
verifier);
grpc_run_bad_client_test("conpfx_22", "PRI * HTTP/2.0\r\n\r\nSM\rX", 22,
verifier);
grpc_run_bad_client_test("conpfx_23", "PRI * HTTP/2.0\r\n\r\nSM\r\nX", 23,
verifier);
grpc_run_bad_client_test("conpfx_24", "PRI * HTTP/2.0\r\n\r\nSM\r\n\rX", 24,
verifier);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "X", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRIX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI X", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI *X", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * X", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTPX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/X", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2X", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.X", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0X", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0\rX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0\r\nX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0\r\n\rX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0\r\n\r\nX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0\r\n\r\nSX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0\r\n\r\nSMX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0\r\n\r\nSM\rX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0\r\n\r\nSM\r\nX", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier, "PRI * HTTP/2.0\r\n\r\nSM\r\n\rX", 0);
return 0;
}

@ -0,0 +1,95 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "test/core/bad_client/bad_client.h"
#include "src/core/surface/server.h"
#define PFX_STR "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
static void verifier(grpc_server *server, grpc_completion_queue *cq) {
while (grpc_server_has_open_connections(server)) {
GPR_ASSERT(
grpc_completion_queue_next(cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20))
.type == GRPC_QUEUE_TIMEOUT);
}
}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
/* various partial prefixes */
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00\x00",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x06",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x06",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00\x06",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00\x00\x04",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00\x00\x04\x00",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00\x00\x04\x01",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00\x00\x04\xff",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00\x00\x04\x00\x00",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00\x00\x04\x00\x00\x00",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier, PFX_STR "\x00\x00\x00\x04\x00\x00\x00\x00",
GRPC_BAD_CLIENT_DISCONNECT);
/* must not send frames with stream id != 0 */
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR "\x00\x00\x00\x04\x00\x00\x00\x00\x01", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR "\x00\x00\x00\x04\x00\x40\x00\x00\x00", 0);
/* settings frame must be a multiple of six bytes long */
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR "\x00\x00\x01\x04\x00\x00\x00\x00\x00", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR "\x00\x00\x02\x04\x00\x00\x00\x00\x00", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR "\x00\x00\x03\x04\x00\x00\x00\x00\x00", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR "\x00\x00\x04\x04\x00\x00\x00\x00\x00", 0);
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR "\x00\x00\x05\x04\x00\x00\x00\x00\x00", 0);
return 0;
}

@ -36,8 +36,12 @@
#include <string.h>
#include "src/core/iomgr/iomgr.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/subprocess.h>
#include <grpc/support/sync.h>
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
static gpr_event g_done;
@ -47,56 +51,93 @@ static gpr_timespec n_seconds_time(int seconds) {
}
static void on_finish(void *arg, const grpc_httpcli_response *response) {
const char *expect =
"<html><head><title>Hello world!</title></head>"
"<body><p>This is a test</p></body></html>";
GPR_ASSERT(arg == (void *)42);
GPR_ASSERT(response);
GPR_ASSERT(response->status == 200);
GPR_ASSERT(response->body_length == strlen(expect));
GPR_ASSERT(0 == memcmp(expect, response->body, response->body_length));
gpr_event_set(&g_done, (void *)1);
}
static void test_get(int use_ssl) {
static void test_get(int use_ssl, int port) {
grpc_httpcli_request req;
char* host;
gpr_log(GPR_INFO, "running %s with use_ssl=%d.", "test_get", use_ssl);
gpr_asprintf(&host, "localhost:%d", port);
gpr_log(GPR_INFO, "requesting from %s", host);
gpr_event_init(&g_done);
memset(&req, 0, sizeof(req));
req.host = "www.google.com";
req.path = "/";
req.host = host;
req.path = "/get";
req.use_ssl = use_ssl;
grpc_httpcli_get(&req, n_seconds_time(15), on_finish, (void *)42);
gpr_free(host);
GPR_ASSERT(gpr_event_wait(&g_done, n_seconds_time(20)));
}
/*
static void test_post(int use_ssl) {
static void test_post(int use_ssl, int port) {
grpc_httpcli_request req;
char* host;
gpr_log(GPR_INFO, "running %s with use_ssl=%d.", "test_post", (int)use_ssl);
gpr_asprintf(&host, "localhost:%d", port);
gpr_log(GPR_INFO, "posting to %s", host);
gpr_event_init(&g_done);
memset(&req, 0, sizeof(req));
req.host = "requestb.in";
req.path = "/1eamwr21";
req.host = host;
req.path = "/post";
req.use_ssl = use_ssl;
grpc_httpcli_post(&req, NULL, 0, n_seconds_time(15), on_finish,
grpc_httpcli_post(&req, "hello", 5, n_seconds_time(15), on_finish,
(void *)42);
GPR_ASSERT(gpr_event_wait(&g_done, n_seconds_time(20)));
}
*/
int main(int argc, char **argv) {
gpr_subprocess* server;
char *me = argv[0];
char *lslash = strrchr(me, '/');
char* args[4];
char root[1024];
int port = grpc_pick_unused_port_or_die();
/* figure out where we are */
if (lslash) {
memcpy(root, me, lslash - me);
root[lslash - me] = 0;
} else {
strcpy(root, ".");
}
/* start the server */
gpr_asprintf(&args[0], "%s/../../test/core/httpcli/test_server.py", root);
args[1] = "--port";
gpr_asprintf(&args[2], "%d", port);
server = gpr_subprocess_create(3, (const char**)args);
GPR_ASSERT(server);
gpr_free(args[0]);
gpr_free(args[2]);
gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_seconds(5)));
grpc_test_init(argc, argv);
grpc_iomgr_init();
test_get(0);
test_get(1);
/* test_post(0); */
/* test_post(1); */
test_get(0, port);
test_post(0, port);
grpc_iomgr_shutdown();
gpr_subprocess_destroy(server);
return 0;
}

@ -0,0 +1,31 @@
#!/usr/bin/env python
"""Server for httpcli_test"""
import argparse
import BaseHTTPServer
argp = argparse.ArgumentParser(description='Server for httpcli_test')
argp.add_argument('-p', '--port', default=10080, type=int)
args = argp.parse_args()
print 'server running on port %d' % args.port
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def good(self):
self.send_response(200)
self.send_header('Content-Type', 'text/html')
self.end_headers()
self.wfile.write('<html><head><title>Hello world!</title></head>')
self.wfile.write('<body><p>This is a test</p></body></html>')
def do_GET(self):
if self.path == '/get':
self.good()
def do_POST(self):
content = self.rfile.read(int(self.headers.getheader('content-length')))
if self.path == '/post' and content == 'hello':
self.good()
BaseHTTPServer.HTTPServer(('', args.port), Handler).serve_forever()

@ -238,6 +238,7 @@ static int set_socket_nonblocking(thread_args *args) {
static int do_nothing(thread_args *args) { return 0; }
#ifdef __linux__
/* Special case for epoll, where we need to create the fd ahead of time. */
static int epoll_setup(thread_args *args) {
int epoll_fd;
@ -258,6 +259,7 @@ static int epoll_setup(thread_args *args) {
}
return 0;
}
#endif
static void server_thread(thread_args *args) {
char *buf = malloc(args->msg_size);

@ -179,10 +179,9 @@ class AsyncClient : public Client {
int t = 0;
for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) {
for (int ch = 0; ch < channel_count_; ch++) {
auto& channel = channels_[ch];
auto* cq = cli_cqs_[t].get();
t = (t + 1) % cli_cqs_.size();
auto ctx = setup_ctx(ch, channel.get_stub(), request_);
auto ctx = setup_ctx(ch, channels_[ch].get_stub(), request_);
if (closed_loop_) {
ctx->Start(cq);
} else {
@ -237,9 +236,9 @@ class AsyncClient : public Client {
}
if ((closed_loop_ || !rpc_deadlines_[thread_idx].empty()) &&
grpc_time_source::now() > deadline) {
// we have missed some 1-second deadline, which is too much
gpr_log(GPR_INFO, "Missed an RPC deadline, giving up");
return false;
// we have missed some 1-second deadline, which is worth noting
gpr_log(GPR_INFO, "Missed an RPC deadline");
// Don't give up, as there might be some truly heavy tails
}
if (got_event) {
ClientRpcContext* ctx = ClientRpcContext::detag(got_tag);

@ -153,7 +153,7 @@ static void QpsDriver() {
FLAGS_warmup_seconds, FLAGS_benchmark_seconds, FLAGS_local_workers);
GetReporter()->ReportQPS(*result);
GetReporter()->ReportQPSPerCore(*result, server_config);
GetReporter()->ReportQPSPerCore(*result);
GetReporter()->ReportLatency(*result);
GetReporter()->ReportTimes(*result);
}

@ -67,7 +67,7 @@ static void RunQPS() {
const auto result =
RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2);
GetReporter()->ReportQPSPerCore(*result, server_config);
GetReporter()->ReportQPSPerCore(*result);
GetReporter()->ReportLatency(*result);
}

@ -70,7 +70,7 @@ static void RunQPS() {
const auto result =
RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2);
GetReporter()->ReportQPSPerCore(*result, server_config);
GetReporter()->ReportQPSPerCore(*result);
GetReporter()->ReportLatency(*result);
}

@ -49,10 +49,9 @@ void CompositeReporter::ReportQPS(const ScenarioResult& result) const {
}
}
void CompositeReporter::ReportQPSPerCore(const ScenarioResult& result,
const ServerConfig& config) const {
void CompositeReporter::ReportQPSPerCore(const ScenarioResult& result) const {
for (size_t i = 0; i < reporters_.size(); ++i) {
reporters_[i]->ReportQPSPerCore(result, config);
reporters_[i]->ReportQPSPerCore(result);
}
}
@ -76,15 +75,14 @@ void GprLogReporter::ReportQPS(const ScenarioResult& result) const {
[](ResourceUsage u) { return u.wall_time; }));
}
void GprLogReporter::ReportQPSPerCore(const ScenarioResult& result,
const ServerConfig& server_config) const {
void GprLogReporter::ReportQPSPerCore(const ScenarioResult& result) const {
auto qps =
result.latencies.Count() /
average(result.client_resources,
[](ResourceUsage u) { return u.wall_time; });
gpr_log(GPR_INFO, "QPS: %.1f (%.1f/server core)", qps,
qps / server_config.threads());
qps / result.server_config.threads());
}
void GprLogReporter::ReportLatency(const ScenarioResult& result) const {

@ -62,8 +62,7 @@ class Reporter {
virtual void ReportQPS(const ScenarioResult& result) const = 0;
/** Reports QPS per core as (YYY/server core). */
virtual void ReportQPSPerCore(const ScenarioResult& result,
const ServerConfig& config) const = 0;
virtual void ReportQPSPerCore(const ScenarioResult& result) const = 0;
/** Reports latencies for the 50, 90, 95, 99 and 99.9 percentiles, in ms. */
virtual void ReportLatency(const ScenarioResult& result) const = 0;
@ -84,8 +83,7 @@ class CompositeReporter : public Reporter {
void add(std::unique_ptr<Reporter> reporter);
void ReportQPS(const ScenarioResult& result) const GRPC_OVERRIDE;
void ReportQPSPerCore(const ScenarioResult& result,
const ServerConfig& config) const GRPC_OVERRIDE;
void ReportQPSPerCore(const ScenarioResult& result) const GRPC_OVERRIDE;
void ReportLatency(const ScenarioResult& result) const GRPC_OVERRIDE;
void ReportTimes(const ScenarioResult& result) const GRPC_OVERRIDE;
@ -100,8 +98,7 @@ class GprLogReporter : public Reporter {
private:
void ReportQPS(const ScenarioResult& result) const GRPC_OVERRIDE;
void ReportQPSPerCore(const ScenarioResult& result,
const ServerConfig& config) const GRPC_OVERRIDE;
void ReportQPSPerCore(const ScenarioResult& result) const GRPC_OVERRIDE;
void ReportLatency(const ScenarioResult& result) const GRPC_OVERRIDE;
void ReportTimes(const ScenarioResult& result) const GRPC_OVERRIDE;
};

@ -34,7 +34,7 @@ RUN git clone --recursive --depth 1 https://github.com/grpc/grpc-java.git /var/l
RUN cd /var/local/git/grpc-java/lib/netty && \
mvn -pl codec-http2 -am -DskipTests install clean
RUN cd /var/local/git/grpc-java && \
./gradlew build installDist
./gradlew :grpc-interop-testing:installDist -PskipCodegen=true
# Add a service_account directory containing the auth creds file
ADD service_account service_account

@ -27,18 +27,21 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Base Dockerfile for the gRPC Java dev image
FROM grpc/base
FROM debian:latest
# Install JDK 8
# Install JDK 8 and Git
#
# TODO(temiola): simplify this if/when a simpler process is available.
#
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
RUN echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
RUN apt-get update && apt-get -y install oracle-java8-installer && \
RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list && \
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \
apt-get update && \
apt-get -y install \
git \
oracle-java8-installer \
&& \
apt-get clean && rm -r /var/cache/oracle-jdk8-installer/
# Install maven
@ -50,15 +53,6 @@ ENV M2_HOME /var/local/apache-maven-3.2.1
ENV PATH $PATH:$JAVA_HOME/bin:$M2_HOME/bin
ENV LD_LIBRARY_PATH /usr/local/lib
# Get the protobuf source from GitHub and install it
RUN wget -O - https://github.com/google/protobuf/archive/v3.0.0-alpha-2.tar.gz | \
tar xz && \
cd protobuf-3.0.0-alpha-2 && \
./autogen.sh && \
./configure --prefix=/usr && \
make -j12 && make check && make install && \
rm -r "$(pwd)"
# Trigger download of as many Maven and Gradle artifacts as possible. We don't build grpc-java
# because we don't want to install netty
RUN git clone --recursive --depth 1 https://github.com/grpc/grpc-java.git && \

@ -60,7 +60,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc/ref/c++
OUTPUT_DIRECTORY = doc/ref/c++.internal
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and

@ -60,7 +60,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = doc/ref/core
OUTPUT_DIRECTORY = doc/ref/core.internal
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and

@ -79,5 +79,41 @@ ENV NUGET mono /var/local/NuGet.exe
# TODO(jtattermusch): add dependencies for other languages
##################
# Node dependencies
# Install nvm
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
RUN /bin/bash -l -c "nvm install 0.12"
##################
# Ruby dependencies
# Install rvm
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
RUN \curl -sSL https://get.rvm.io | bash -s stable
# Install Ruby 2.1
RUN /bin/bash -l -c "rvm install ruby-2.1"
RUN /bin/bash -l -c "rvm use --default ruby-2.1"
RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
##################
# Python dependencies
# Install dependencies
RUN apt-get update && apt-get install -y \
python-all-dev \
python3-all-dev \
python-pip \
python-virtualenv
# Install Python packages from PyPI
RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2
# Define the default command.
CMD ["bash"]

@ -42,9 +42,11 @@ then
echo "building $language on Linux"
# Run tests inside docker
docker run grpc/grpc_jenkins_slave bash -c "git clone --recursive $GIT_URL /var/local/git/grpc \
docker run grpc/grpc_jenkins_slave bash -c -l "git clone --recursive $GIT_URL /var/local/git/grpc \
&& cd /var/local/git/grpc && git checkout -f $GIT_COMMIT \
&& git submodule update \
&& nvm use 0.12 \
&& rvm use ruby-2.1 \
&& tools/run_tests/run_tests.py -t -l $language"
elif [ "$platform" == "windows" ]
then

@ -41,4 +41,4 @@ export LDFLAGS=-L`pwd`/libs/$CONFIG
cd src/node
npm install
npm install --unsafe-perm

@ -348,6 +348,15 @@
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "httpcli_test",
"platforms": [
"windows",
"posix"
]
},
{
"flaky": false,
"language": "c",
@ -4691,6 +4700,15 @@
"windows",
"posix"
]
},
{
"flaky": false,
"language": "c",
"name": "initial_settings_frame_bad_client_test",
"platforms": [
"windows",
"posix"
]
}
]

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save