Merge branch 'master' into xiaohaoliang-patch-1

pull/9970/head
Jan Tattermusch 8 years ago committed by GitHub
commit ccf2a6a707
  1. 1
      .clang_complete
  2. 15
      .gitignore
  3. 7
      .gitmodules
  4. 28
      .pylintrc
  5. 30
      .vscode/launch.json
  6. 389
      BUILD
  7. 3647
      CMakeLists.txt
  8. 49
      INSTALL.md
  9. 3436
      Makefile
  10. 2
      PYTHON-MANIFEST.in
  11. 41
      README.md
  12. 5
      Rakefile
  13. 33
      WORKSPACE
  14. 4
      bazel/BUILD
  15. 28
      bazel/cc_grpc_library.bzl
  16. 42
      bazel/generate_cc.bzl
  17. 22
      bazel/grpc_build_system.bzl
  18. 231
      binding.gyp
  19. 684
      build.yaml
  20. 2
      build_config.rb
  21. 2
      cmake/msvc_static_runtime.cmake
  22. 181
      config.m4
  23. 26
      doc/PROTOCOL-HTTP2.md
  24. 5
      doc/PROTOCOL-WEB.md
  25. 2
      doc/binary-logging.md
  26. 158
      doc/combiner-explainer.md
  27. 160
      doc/core/grpc-error.md
  28. 9
      doc/environment_variables.md
  29. 2
      doc/g_stands_for.md
  30. 76
      doc/http2-interop-test-descriptions.md
  31. 10
      doc/interop-test-descriptions.md
  32. 4
      doc/server_side_auth.md
  33. 21
      doc/service_config.md
  34. 16
      doc/status_ordering.md
  35. 19
      doc/statuscodes.md
  36. 184
      etc/roots.pem
  37. 32
      examples/BUILD
  38. 2
      examples/cpp/README.md
  39. 2
      examples/cpp/cpptutorial.md
  40. 34
      examples/csharp/helloworld-from-cli/Greeter.sln
  41. 19
      examples/csharp/helloworld-from-cli/Greeter/Greeter.csproj
  42. 37
      examples/csharp/helloworld-from-cli/Greeter/Helloworld.cs
  43. 73
      examples/csharp/helloworld-from-cli/Greeter/HelloworldGrpc.cs
  44. 31
      examples/csharp/helloworld-from-cli/Greeter/project.json
  45. 17
      examples/csharp/helloworld-from-cli/GreeterClient/GreeterClient.csproj
  46. 35
      examples/csharp/helloworld-from-cli/GreeterClient/project.json
  47. 17
      examples/csharp/helloworld-from-cli/GreeterServer/GreeterServer.csproj
  48. 35
      examples/csharp/helloworld-from-cli/GreeterServer/project.json
  49. 17
      examples/csharp/helloworld-from-cli/README.md
  50. 42
      examples/csharp/helloworld-from-cli/generate_protos.bat
  51. 29
      examples/csharp/helloworld/Greeter/Greeter.csproj
  52. 37
      examples/csharp/helloworld/Greeter/Helloworld.cs
  53. 73
      examples/csharp/helloworld/Greeter/HelloworldGrpc.cs
  54. 12
      examples/csharp/helloworld/Greeter/packages.config
  55. 29
      examples/csharp/helloworld/GreeterClient/GreeterClient.csproj
  56. 10
      examples/csharp/helloworld/GreeterClient/packages.config
  57. 29
      examples/csharp/helloworld/GreeterServer/GreeterServer.csproj
  58. 10
      examples/csharp/helloworld/GreeterServer/packages.config
  59. 2
      examples/csharp/helloworld/generate_protos.bat
  60. 2
      examples/csharp/route_guide/README.md
  61. 46
      examples/csharp/route_guide/RouteGuide/RouteGuide.cs
  62. 31
      examples/csharp/route_guide/RouteGuide/RouteGuide.csproj
  63. 248
      examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
  64. 10
      examples/csharp/route_guide/RouteGuide/packages.config
  65. 29
      examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj
  66. 10
      examples/csharp/route_guide/RouteGuideClient/packages.config
  67. 31
      examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj
  68. 12
      examples/csharp/route_guide/RouteGuideServer/packages.config
  69. 2
      examples/csharp/route_guide/generate_protos.bat
  70. 2
      examples/node/dynamic_codegen/route_guide/README.md
  71. 9
      examples/node/static_codegen/README.md
  72. 2
      examples/node/static_codegen/route_guide/README.md
  73. 2
      examples/objective-c/auth_sample/README.md
  74. 2
      examples/objective-c/helloworld/README.md
  75. 2
      examples/objective-c/route_guide/README.md
  76. 2
      examples/php/route_guide/README.md
  77. 25
      examples/ruby/errors_and_cancellation/README.md
  78. 117
      examples/ruby/errors_and_cancellation/error_examples_client.rb
  79. 76
      examples/ruby/errors_and_cancellation/error_examples_server.rb
  80. 2
      examples/ruby/route_guide/README.md
  81. 287
      gRPC-Core.podspec
  82. 4
      gRPC-ProtoRPC.podspec
  83. 4
      gRPC-RxLibrary.podspec
  84. 4
      gRPC.podspec
  85. 14
      grpc.def
  86. 262
      grpc.gemspec
  87. 28
      include/grpc++/impl/channel_argument_option.h
  88. 330
      include/grpc++/impl/codegen/async_stream.h
  89. 91
      include/grpc++/impl/codegen/async_unary_call.h
  90. 179
      include/grpc++/impl/codegen/call.h
  91. 15
      include/grpc++/impl/codegen/client_context.h
  92. 4
      include/grpc++/impl/codegen/client_unary_call.h
  93. 50
      include/grpc++/impl/codegen/completion_queue.h
  94. 20
      include/grpc++/impl/codegen/core_codegen.h
  95. 13
      include/grpc++/impl/codegen/core_codegen_interface.h
  96. 26
      include/grpc++/impl/codegen/grpc_library.h
  97. 2
      include/grpc++/impl/codegen/proto_utils.h
  98. 4
      include/grpc++/impl/codegen/server_context.h
  99. 4
      include/grpc++/impl/codegen/server_interface.h
  100. 22
      include/grpc++/impl/codegen/status.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -4,5 +4,6 @@
-Igens -Igens
-I. -I.
-Ithird_party/boringssl/include -Ithird_party/boringssl/include
-Ithird_party/benchmark/include
-Ithird_party/zlib -Ithird_party/zlib
-Ithird_party/protobuf/src -Ithird_party/protobuf/src

15
.gitignore vendored

@ -8,7 +8,7 @@ objs
# Python items # Python items
cython_debug/ cython_debug/
python_build/ python_build/
python_format_venv/ yapf_virtual_environment/
python_pylint_venv/ python_pylint_venv/
.coverage* .coverage*
.eggs .eggs
@ -115,3 +115,16 @@ bazel-testlogs
# Debug output # Debug output
gdb.txt gdb.txt
# ctags file
tags
# perf data
perf.data
perf.data.old
# bm_diff
bm_diff_new/
bm_diff_old/
bm_*.json

7
.gitmodules vendored

@ -14,12 +14,13 @@
[submodule "third_party/boringssl"] [submodule "third_party/boringssl"]
path = third_party/boringssl path = third_party/boringssl
url = https://github.com/google/boringssl.git url = https://github.com/google/boringssl.git
[submodule "third_party/thrift"]
path = third_party/thrift
url = https://github.com/apache/thrift.git
[submodule "third_party/benchmark"] [submodule "third_party/benchmark"]
path = third_party/benchmark path = third_party/benchmark
url = https://github.com/google/benchmark url = https://github.com/google/benchmark
[submodule "third_party/boringssl-with-bazel"] [submodule "third_party/boringssl-with-bazel"]
path = third_party/boringssl-with-bazel path = third_party/boringssl-with-bazel
url = https://boringssl.googlesource.com/boringssl url = https://boringssl.googlesource.com/boringssl
[submodule "third_party/cares/cares"]
path = third_party/cares/cares
url = https://github.com/c-ares/c-ares.git
branch = cares-1_12_0

@ -3,34 +3,38 @@
# not include "unused_" and "ignored_" by default? # not include "unused_" and "ignored_" by default?
dummy-variables-rgx=^ignored_|^unused_ dummy-variables-rgx=^ignored_|^unused_
[DESIGN]
# NOTE(nathaniel): Not particularly attached to this value; it just seems to
# be what works for us at the moment (excepting the dead-code-walking Beta
# API).
max-args=6
[MISCELLANEOUS]
# NOTE(nathaniel): We are big fans of "TODO(<issue link>): " and
# "NOTE(<username or issue link>): ". We do not allow "TODO:",
# "TODO(<username>):", "FIXME:", or anything else.
notes=FIXME,XXX
[MESSAGES CONTROL] [MESSAGES CONTROL]
#TODO: Enable missing-docstring #TODO: Enable missing-docstring
#TODO: Enable too-few-public-methods #TODO: Enable too-few-public-methods
#TODO: Enable too-many-arguments
#TODO: Enable no-init #TODO: Enable no-init
#TODO: Enable duplicate-code #TODO: Enable duplicate-code
#TODO: Enable invalid-name #TODO: Enable invalid-name
#TODO: Enable suppressed-message
#TODO: Enable locally-disabled #TODO: Enable locally-disabled
#TODO: Enable protected-access #TODO: Enable protected-access
#TODO: Enable no-name-in-module #TODO: Enable no-name-in-module
#TODO: Enable unused-argument
#TODO: Enable fixme
#TODO: Enable wrong-import-order #TODO: Enable wrong-import-order
#TODO: Enable no-value-for-parameter # TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279):
#TODO: Enable cyclic-import # enable cyclic-import after a 1.7-or-later pylint release that recognizes our
#TODO: Enable redefined-outer-name # disable=cyclic-import suppressions.
#TODO: Enable too-many-instance-attributes #TODO: Enable too-many-instance-attributes
#TODO: Enable broad-except
#TODO: Enable too-many-locals
#TODO: Enable too-many-lines #TODO: Enable too-many-lines
#TODO: Enable redefined-variable-type #TODO: Enable redefined-variable-type
#TODO: Enable next-method-called #TODO: Enable next-method-called
#TODO: Enable import-error #TODO: Enable import-error
#TODO: Enable useless-else-on-loop #TODO: Enable useless-else-on-loop
#TODO: Enable too-many-return-statements
#TODO: Enable too-many-nested-blocks #TODO: Enable too-many-nested-blocks
#TODO: Enable super-init-not-called
disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,suppressed-message,locally-disabled,protected-access,no-name-in-module,unused-argument,fixme,wrong-import-order,no-value-for-parameter,cyclic-import,redefined-outer-name,too-many-instance-attributes,broad-except,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-nested-blocks

@ -0,0 +1,30 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/mocha",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/mocha.cmd"
},
"runtimeArgs": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"${workspaceRoot}/src/node/test"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "attach",
"name": "Attach to Process",
"port": 5858
}
]
}

389
BUILD

@ -35,13 +35,15 @@ exports_files(["LICENSE"])
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_proto_plugin") load("//bazel:grpc_build_system.bzl", "grpc_cc_library",
"grpc_proto_plugin", "grpc_cc_libraries")
g_stands_for = "good" # This should be updated along with build.yaml
g_stands_for = "gregarious"
core_version = "2.0.0-dev" core_version = "3.0.0-dev"
version = "1.1.0-dev" version = "1.4.0-dev"
grpc_cc_library( grpc_cc_library(
name = "gpr", name = "gpr",
@ -52,28 +54,45 @@ grpc_cc_library(
], ],
) )
grpc_cc_library( grpc_cc_libraries(
name = "grpc", name_list = ["grpc", "grpc_unsecure",],
srcs = [ srcs = [
"src/core/lib/surface/init.c", "src/core/lib/surface/init.c",
"src/core/plugin_registry/grpc_plugin_registry.c", ],
additional_src_list = [
[
"src/core/plugin_registry/grpc_plugin_registry.c",
],
[
"src/core/lib/surface/init_unsecure.c",
"src/core/plugin_registry/grpc_unsecure_plugin_registry.c",
],
], ],
language = "c", language = "c",
standalone = True, standalone = True,
deps = [ deps = [
"census", "census",
"grpc_base", "grpc_base",
"grpc_lb_policy_grpclb_secure",
"grpc_lb_policy_pick_first", "grpc_lb_policy_pick_first",
"grpc_lb_policy_round_robin", "grpc_lb_policy_round_robin",
"grpc_load_reporting", "grpc_load_reporting",
"grpc_max_age_filter",
"grpc_resolver_dns_native", "grpc_resolver_dns_native",
"grpc_resolver_sockaddr", "grpc_resolver_sockaddr",
"grpc_secure",
"grpc_transport_chttp2_client_insecure", "grpc_transport_chttp2_client_insecure",
"grpc_transport_chttp2_client_secure",
"grpc_transport_chttp2_server_insecure", "grpc_transport_chttp2_server_insecure",
"grpc_transport_chttp2_server_secure", "grpc_message_size_filter",
"grpc_deadline_filter",
],
additional_dep_list = [
[
"grpc_secure",
"grpc_resolver_dns_ares",
"grpc_lb_policy_grpclb_secure",
"grpc_transport_chttp2_client_secure",
"grpc_transport_chttp2_server_secure",
],
[],
], ],
) )
@ -88,29 +107,7 @@ grpc_cc_library(
"grpc_base", "grpc_base",
"grpc_transport_chttp2_client_secure", "grpc_transport_chttp2_client_secure",
"grpc_transport_cronet_client_secure", "grpc_transport_cronet_client_secure",
], "grpc_http_filters",
)
grpc_cc_library(
name = "grpc_unsecure",
srcs = [
"src/core/lib/surface/init.c",
"src/core/lib/surface/init_unsecure.c",
"src/core/plugin_registry/grpc_unsecure_plugin_registry.c",
],
language = "c",
standalone = True,
deps = [
"census",
"grpc_base",
"grpc_lb_policy_grpclb",
"grpc_lb_policy_pick_first",
"grpc_lb_policy_round_robin",
"grpc_load_reporting",
"grpc_resolver_dns_native",
"grpc_resolver_sockaddr",
"grpc_transport_chttp2_client_insecure",
"grpc_transport_chttp2_server_insecure",
], ],
) )
@ -154,13 +151,29 @@ grpc_cc_library(
standalone = True, standalone = True,
deps = [ deps = [
"gpr", "gpr",
"grpc++_base", "grpc++_base_unsecure",
"grpc++_codegen_base", "grpc++_codegen_base",
"grpc++_codegen_base_src", "grpc++_codegen_base_src",
"grpc_unsecure", "grpc_unsecure",
], ],
) )
grpc_cc_library(
name = "grpc++_error_details",
srcs = [
"src/cpp/util/error_details.cc",
],
hdrs = [
"include/grpc++/support/error_details.h",
],
language = "c++",
standalone = True,
deps = [
"grpc++",
"//src/proto/grpc/status:status_proto",
],
)
grpc_cc_library( grpc_cc_library(
name = "grpc_plugin_support", name = "grpc_plugin_support",
srcs = [ srcs = [
@ -185,11 +198,15 @@ grpc_cc_library(
"src/compiler/objective_c_generator_helpers.h", "src/compiler/objective_c_generator_helpers.h",
"src/compiler/php_generator.h", "src/compiler/php_generator.h",
"src/compiler/php_generator_helpers.h", "src/compiler/php_generator_helpers.h",
"src/compiler/protobuf_plugin.h",
"src/compiler/python_generator.h", "src/compiler/python_generator.h",
"src/compiler/python_generator_helpers.h",
"src/compiler/python_private_generator.h",
"src/compiler/ruby_generator.h", "src/compiler/ruby_generator.h",
"src/compiler/ruby_generator_helpers-inl.h", "src/compiler/ruby_generator_helpers-inl.h",
"src/compiler/ruby_generator_map-inl.h", "src/compiler/ruby_generator_map-inl.h",
"src/compiler/ruby_generator_string-inl.h", "src/compiler/ruby_generator_string-inl.h",
"src/compiler/schema_interface.h",
], ],
external_deps = [ external_deps = [
"protobuf_clib", "protobuf_clib",
@ -309,6 +326,8 @@ grpc_cc_library(
"src/core/lib/profiling/basic_timers.c", "src/core/lib/profiling/basic_timers.c",
"src/core/lib/profiling/stap_timers.c", "src/core/lib/profiling/stap_timers.c",
"src/core/lib/support/alloc.c", "src/core/lib/support/alloc.c",
"src/core/lib/support/arena.c",
"src/core/lib/support/atm.c",
"src/core/lib/support/avl.c", "src/core/lib/support/avl.c",
"src/core/lib/support/backoff.c", "src/core/lib/support/backoff.c",
"src/core/lib/support/cmdline.c", "src/core/lib/support/cmdline.c",
@ -353,9 +372,14 @@ grpc_cc_library(
], ],
hdrs = [ hdrs = [
"src/core/lib/profiling/timers.h", "src/core/lib/profiling/timers.h",
"src/core/lib/support/arena.h",
"src/core/lib/support/backoff.h", "src/core/lib/support/backoff.h",
"src/core/lib/support/block_annotate.h", "src/core/lib/support/block_annotate.h",
"src/core/lib/support/env.h", "src/core/lib/support/env.h",
"src/core/lib/support/memory.h",
"src/core/lib/support/atomic.h",
"src/core/lib/support/atomic_with_atm.h",
"src/core/lib/support/atomic_with_std.h",
"src/core/lib/support/mpscq.h", "src/core/lib/support/mpscq.h",
"src/core/lib/support/murmur_hash.h", "src/core/lib/support/murmur_hash.h",
"src/core/lib/support/spinlock.h", "src/core/lib/support/spinlock.h",
@ -411,7 +435,6 @@ grpc_cc_library(
"include/grpc/impl/codegen/gpr_slice.h", "include/grpc/impl/codegen/gpr_slice.h",
"include/grpc/impl/codegen/gpr_types.h", "include/grpc/impl/codegen/gpr_types.h",
"include/grpc/impl/codegen/port_platform.h", "include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
"include/grpc/impl/codegen/sync.h", "include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h", "include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h", "include/grpc/impl/codegen/sync_posix.h",
@ -425,15 +448,10 @@ grpc_cc_library(
"src/core/lib/channel/channel_args.c", "src/core/lib/channel/channel_args.c",
"src/core/lib/channel/channel_stack.c", "src/core/lib/channel/channel_stack.c",
"src/core/lib/channel/channel_stack_builder.c", "src/core/lib/channel/channel_stack_builder.c",
"src/core/lib/channel/compress_filter.c",
"src/core/lib/channel/connected_channel.c", "src/core/lib/channel/connected_channel.c",
"src/core/lib/channel/deadline_filter.c",
"src/core/lib/channel/handshaker.c", "src/core/lib/channel/handshaker.c",
"src/core/lib/channel/handshaker_factory.c", "src/core/lib/channel/handshaker_factory.c",
"src/core/lib/channel/handshaker_registry.c", "src/core/lib/channel/handshaker_registry.c",
"src/core/lib/channel/http_client_filter.c",
"src/core/lib/channel/http_server_filter.c",
"src/core/lib/channel/message_size_filter.c",
"src/core/lib/compression/compression.c", "src/core/lib/compression/compression.c",
"src/core/lib/compression/message_compress.c", "src/core/lib/compression/message_compress.c",
"src/core/lib/debug/trace.c", "src/core/lib/debug/trace.c",
@ -458,6 +476,7 @@ grpc_cc_library(
"src/core/lib/iomgr/iomgr_uv.c", "src/core/lib/iomgr/iomgr_uv.c",
"src/core/lib/iomgr/iomgr_windows.c", "src/core/lib/iomgr/iomgr_windows.c",
"src/core/lib/iomgr/load_file.c", "src/core/lib/iomgr/load_file.c",
"src/core/lib/iomgr/lockfree_event.c",
"src/core/lib/iomgr/network_status_tracker.c", "src/core/lib/iomgr/network_status_tracker.c",
"src/core/lib/iomgr/polling_entity.c", "src/core/lib/iomgr/polling_entity.c",
"src/core/lib/iomgr/pollset_set_uv.c", "src/core/lib/iomgr/pollset_set_uv.c",
@ -469,6 +488,7 @@ grpc_cc_library(
"src/core/lib/iomgr/resolve_address_windows.c", "src/core/lib/iomgr/resolve_address_windows.c",
"src/core/lib/iomgr/resource_quota.c", "src/core/lib/iomgr/resource_quota.c",
"src/core/lib/iomgr/sockaddr_utils.c", "src/core/lib/iomgr/sockaddr_utils.c",
"src/core/lib/iomgr/socket_factory_posix.c",
"src/core/lib/iomgr/socket_mutator.c", "src/core/lib/iomgr/socket_mutator.c",
"src/core/lib/iomgr/socket_utils_common_posix.c", "src/core/lib/iomgr/socket_utils_common_posix.c",
"src/core/lib/iomgr/socket_utils_linux.c", "src/core/lib/iomgr/socket_utils_linux.c",
@ -481,6 +501,9 @@ grpc_cc_library(
"src/core/lib/iomgr/tcp_client_windows.c", "src/core/lib/iomgr/tcp_client_windows.c",
"src/core/lib/iomgr/tcp_posix.c", "src/core/lib/iomgr/tcp_posix.c",
"src/core/lib/iomgr/tcp_server_posix.c", "src/core/lib/iomgr/tcp_server_posix.c",
"src/core/lib/iomgr/tcp_server_utils_posix_common.c",
"src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c",
"src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c",
"src/core/lib/iomgr/tcp_server_uv.c", "src/core/lib/iomgr/tcp_server_uv.c",
"src/core/lib/iomgr/tcp_server_windows.c", "src/core/lib/iomgr/tcp_server_windows.c",
"src/core/lib/iomgr/tcp_uv.c", "src/core/lib/iomgr/tcp_uv.c",
@ -503,6 +526,7 @@ grpc_cc_library(
"src/core/lib/json/json_reader.c", "src/core/lib/json/json_reader.c",
"src/core/lib/json/json_string.c", "src/core/lib/json/json_string.c",
"src/core/lib/json/json_writer.c", "src/core/lib/json/json_writer.c",
"src/core/lib/slice/b64.c",
"src/core/lib/slice/percent_encoding.c", "src/core/lib/slice/percent_encoding.c",
"src/core/lib/slice/slice.c", "src/core/lib/slice/slice.c",
"src/core/lib/slice/slice_buffer.c", "src/core/lib/slice/slice_buffer.c",
@ -521,8 +545,9 @@ grpc_cc_library(
"src/core/lib/surface/channel_ping.c", "src/core/lib/surface/channel_ping.c",
"src/core/lib/surface/channel_stack_type.c", "src/core/lib/surface/channel_stack_type.c",
"src/core/lib/surface/completion_queue.c", "src/core/lib/surface/completion_queue.c",
"src/core/lib/surface/completion_queue_factory.c",
"src/core/lib/surface/event_string.c", "src/core/lib/surface/event_string.c",
"src/core/lib/surface/lame_client.c", "src/core/lib/surface/lame_client.cc",
"src/core/lib/surface/metadata_array.c", "src/core/lib/surface/metadata_array.c",
"src/core/lib/surface/server.c", "src/core/lib/surface/server.c",
"src/core/lib/surface/validate_metadata.c", "src/core/lib/surface/validate_metadata.c",
@ -545,16 +570,11 @@ grpc_cc_library(
"src/core/lib/channel/channel_args.h", "src/core/lib/channel/channel_args.h",
"src/core/lib/channel/channel_stack.h", "src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h", "src/core/lib/channel/channel_stack_builder.h",
"src/core/lib/channel/compress_filter.h",
"src/core/lib/channel/connected_channel.h", "src/core/lib/channel/connected_channel.h",
"src/core/lib/channel/context.h", "src/core/lib/channel/context.h",
"src/core/lib/channel/deadline_filter.h",
"src/core/lib/channel/handshaker.h", "src/core/lib/channel/handshaker.h",
"src/core/lib/channel/handshaker_factory.h", "src/core/lib/channel/handshaker_factory.h",
"src/core/lib/channel/handshaker_registry.h", "src/core/lib/channel/handshaker_registry.h",
"src/core/lib/channel/http_client_filter.h",
"src/core/lib/channel/http_server_filter.h",
"src/core/lib/channel/message_size_filter.h",
"src/core/lib/compression/algorithm_metadata.h", "src/core/lib/compression/algorithm_metadata.h",
"src/core/lib/compression/message_compress.h", "src/core/lib/compression/message_compress.h",
"src/core/lib/debug/trace.h", "src/core/lib/debug/trace.h",
@ -577,6 +597,7 @@ grpc_cc_library(
"src/core/lib/iomgr/iomgr_internal.h", "src/core/lib/iomgr/iomgr_internal.h",
"src/core/lib/iomgr/iomgr_posix.h", "src/core/lib/iomgr/iomgr_posix.h",
"src/core/lib/iomgr/load_file.h", "src/core/lib/iomgr/load_file.h",
"src/core/lib/iomgr/lockfree_event.h",
"src/core/lib/iomgr/network_status_tracker.h", "src/core/lib/iomgr/network_status_tracker.h",
"src/core/lib/iomgr/polling_entity.h", "src/core/lib/iomgr/polling_entity.h",
"src/core/lib/iomgr/pollset.h", "src/core/lib/iomgr/pollset.h",
@ -591,6 +612,7 @@ grpc_cc_library(
"src/core/lib/iomgr/sockaddr_posix.h", "src/core/lib/iomgr/sockaddr_posix.h",
"src/core/lib/iomgr/sockaddr_utils.h", "src/core/lib/iomgr/sockaddr_utils.h",
"src/core/lib/iomgr/sockaddr_windows.h", "src/core/lib/iomgr/sockaddr_windows.h",
"src/core/lib/iomgr/socket_factory_posix.h",
"src/core/lib/iomgr/socket_mutator.h", "src/core/lib/iomgr/socket_mutator.h",
"src/core/lib/iomgr/socket_utils.h", "src/core/lib/iomgr/socket_utils.h",
"src/core/lib/iomgr/socket_utils_posix.h", "src/core/lib/iomgr/socket_utils_posix.h",
@ -599,6 +621,7 @@ grpc_cc_library(
"src/core/lib/iomgr/tcp_client_posix.h", "src/core/lib/iomgr/tcp_client_posix.h",
"src/core/lib/iomgr/tcp_posix.h", "src/core/lib/iomgr/tcp_posix.h",
"src/core/lib/iomgr/tcp_server.h", "src/core/lib/iomgr/tcp_server.h",
"src/core/lib/iomgr/tcp_server_utils_posix.h",
"src/core/lib/iomgr/tcp_uv.h", "src/core/lib/iomgr/tcp_uv.h",
"src/core/lib/iomgr/tcp_windows.h", "src/core/lib/iomgr/tcp_windows.h",
"src/core/lib/iomgr/time_averaged_stats.h", "src/core/lib/iomgr/time_averaged_stats.h",
@ -618,6 +641,7 @@ grpc_cc_library(
"src/core/lib/json/json_common.h", "src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.h", "src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h", "src/core/lib/json/json_writer.h",
"src/core/lib/slice/b64.h",
"src/core/lib/slice/percent_encoding.h", "src/core/lib/slice/percent_encoding.h",
"src/core/lib/slice/slice_hash_table.h", "src/core/lib/slice/slice_hash_table.h",
"src/core/lib/slice/slice_internal.h", "src/core/lib/slice/slice_internal.h",
@ -629,6 +653,7 @@ grpc_cc_library(
"src/core/lib/surface/channel_init.h", "src/core/lib/surface/channel_init.h",
"src/core/lib/surface/channel_stack_type.h", "src/core/lib/surface/channel_stack_type.h",
"src/core/lib/surface/completion_queue.h", "src/core/lib/surface/completion_queue.h",
"src/core/lib/surface/completion_queue_factory.h",
"src/core/lib/surface/event_string.h", "src/core/lib/surface/event_string.h",
"src/core/lib/surface/init.h", "src/core/lib/surface/init.h",
"src/core/lib/surface/lame_client.h", "src/core/lib/surface/lame_client.h",
@ -674,47 +699,108 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc_client_channel", name = "grpc_client_channel",
srcs = [ srcs = [
"src/core/ext/client_channel/channel_connectivity.c", "src/core/ext/filters/client_channel/channel_connectivity.c",
"src/core/ext/client_channel/client_channel.c", "src/core/ext/filters/client_channel/client_channel.c",
"src/core/ext/client_channel/client_channel_factory.c", "src/core/ext/filters/client_channel/client_channel_factory.c",
"src/core/ext/client_channel/client_channel_plugin.c", "src/core/ext/filters/client_channel/client_channel_plugin.c",
"src/core/ext/client_channel/connector.c", "src/core/ext/filters/client_channel/connector.c",
"src/core/ext/client_channel/default_initial_connect_string.c", "src/core/ext/filters/client_channel/http_connect_handshaker.c",
"src/core/ext/client_channel/http_connect_handshaker.c", "src/core/ext/filters/client_channel/http_proxy.c",
"src/core/ext/client_channel/http_proxy.c", "src/core/ext/filters/client_channel/lb_policy.c",
"src/core/ext/client_channel/initial_connect_string.c", "src/core/ext/filters/client_channel/lb_policy_factory.c",
"src/core/ext/client_channel/lb_policy.c", "src/core/ext/filters/client_channel/lb_policy_registry.c",
"src/core/ext/client_channel/lb_policy_factory.c", "src/core/ext/filters/client_channel/parse_address.c",
"src/core/ext/client_channel/lb_policy_registry.c", "src/core/ext/filters/client_channel/proxy_mapper.c",
"src/core/ext/client_channel/parse_address.c", "src/core/ext/filters/client_channel/proxy_mapper_registry.c",
"src/core/ext/client_channel/proxy_mapper.c", "src/core/ext/filters/client_channel/resolver.c",
"src/core/ext/client_channel/proxy_mapper_registry.c", "src/core/ext/filters/client_channel/resolver_factory.c",
"src/core/ext/client_channel/resolver.c", "src/core/ext/filters/client_channel/resolver_registry.c",
"src/core/ext/client_channel/resolver_factory.c", "src/core/ext/filters/client_channel/retry_throttle.c",
"src/core/ext/client_channel/resolver_registry.c", "src/core/ext/filters/client_channel/subchannel.c",
"src/core/ext/client_channel/subchannel.c", "src/core/ext/filters/client_channel/subchannel_index.c",
"src/core/ext/client_channel/subchannel_index.c", "src/core/ext/filters/client_channel/uri_parser.c",
"src/core/ext/client_channel/uri_parser.c", ],
hdrs = [
"src/core/ext/filters/client_channel/client_channel.h",
"src/core/ext/filters/client_channel/client_channel_factory.h",
"src/core/ext/filters/client_channel/connector.h",
"src/core/ext/filters/client_channel/http_connect_handshaker.h",
"src/core/ext/filters/client_channel/http_proxy.h",
"src/core/ext/filters/client_channel/lb_policy.h",
"src/core/ext/filters/client_channel/lb_policy_factory.h",
"src/core/ext/filters/client_channel/lb_policy_registry.h",
"src/core/ext/filters/client_channel/parse_address.h",
"src/core/ext/filters/client_channel/proxy_mapper.h",
"src/core/ext/filters/client_channel/proxy_mapper_registry.h",
"src/core/ext/filters/client_channel/resolver.h",
"src/core/ext/filters/client_channel/resolver_factory.h",
"src/core/ext/filters/client_channel/resolver_registry.h",
"src/core/ext/filters/client_channel/retry_throttle.h",
"src/core/ext/filters/client_channel/subchannel.h",
"src/core/ext/filters/client_channel/subchannel_index.h",
"src/core/ext/filters/client_channel/uri_parser.h",
],
language = "c",
deps = [
"grpc_base",
"grpc_deadline_filter",
],
)
grpc_cc_library(
name = "grpc_max_age_filter",
srcs = [
"src/core/ext/filters/max_age/max_age_filter.c",
],
hdrs = [
"src/core/ext/filters/max_age/max_age_filter.h",
],
language = "c",
deps = [
"grpc_base",
],
)
grpc_cc_library(
name = "grpc_deadline_filter",
srcs = [
"src/core/ext/filters/deadline/deadline_filter.c",
],
hdrs = [
"src/core/ext/filters/deadline/deadline_filter.h",
],
language = "c",
deps = [
"grpc_base",
],
)
grpc_cc_library(
name = "grpc_message_size_filter",
srcs = [
"src/core/ext/filters/message_size/message_size_filter.c",
], ],
hdrs = [ hdrs = [
"src/core/ext/client_channel/client_channel.h", "src/core/ext/filters/message_size/message_size_filter.h",
"src/core/ext/client_channel/client_channel_factory.h", ],
"src/core/ext/client_channel/connector.h", language = "c",
"src/core/ext/client_channel/http_connect_handshaker.h", deps = [
"src/core/ext/client_channel/http_proxy.h", "grpc_base",
"src/core/ext/client_channel/initial_connect_string.h", ],
"src/core/ext/client_channel/lb_policy.h", )
"src/core/ext/client_channel/lb_policy_factory.h",
"src/core/ext/client_channel/lb_policy_registry.h", grpc_cc_library(
"src/core/ext/client_channel/parse_address.h", name = "grpc_http_filters",
"src/core/ext/client_channel/proxy_mapper.h", hdrs = [
"src/core/ext/client_channel/proxy_mapper_registry.h", "src/core/ext/filters/http/message_compress/message_compress_filter.h",
"src/core/ext/client_channel/resolver.h", "src/core/ext/filters/http/client/http_client_filter.h",
"src/core/ext/client_channel/resolver_factory.h", "src/core/ext/filters/http/server/http_server_filter.h",
"src/core/ext/client_channel/resolver_registry.h", ],
"src/core/ext/client_channel/subchannel.h", srcs = [
"src/core/ext/client_channel/subchannel_index.h", "src/core/ext/filters/http/message_compress/message_compress_filter.c",
"src/core/ext/client_channel/uri_parser.h", "src/core/ext/filters/http/client/http_client_filter.c",
"src/core/ext/filters/http/server/http_server_filter.c",
"src/core/ext/filters/http/http_filters_plugin.c"
], ],
language = "c", language = "c",
deps = [ deps = [
@ -733,6 +819,7 @@ grpc_cc_library(
"include/grpc/impl/codegen/grpc_types.h", "include/grpc/impl/codegen/grpc_types.h",
"include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/status.h", "include/grpc/impl/codegen/status.h",
"include/grpc/impl/codegen/slice.h",
], ],
deps = [ deps = [
"gpr_codegen", "gpr_codegen",
@ -742,16 +829,20 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc_lb_policy_grpclb", name = "grpc_lb_policy_grpclb",
srcs = [ srcs = [
"src/core/ext/lb_policy/grpclb/grpclb.c", "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c",
"src/core/ext/lb_policy/grpclb/grpclb_channel.c", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c",
"src/core/ext/lb_policy/grpclb/load_balancer_api.c", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.c",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c",
], ],
hdrs = [ hdrs = [
"src/core/ext/lb_policy/grpclb/grpclb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h",
"src/core/ext/lb_policy/grpclb/grpclb_channel.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h",
], ],
external_deps = [ external_deps = [
"nanopb", "nanopb",
@ -766,16 +857,20 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc_lb_policy_grpclb_secure", name = "grpc_lb_policy_grpclb_secure",
srcs = [ srcs = [
"src/core/ext/lb_policy/grpclb/grpclb.c", "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c",
"src/core/ext/lb_policy/grpclb/grpclb_channel_secure.c", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c",
"src/core/ext/lb_policy/grpclb/load_balancer_api.c", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.c",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c",
], ],
hdrs = [ hdrs = [
"src/core/ext/lb_policy/grpclb/grpclb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h",
"src/core/ext/lb_policy/grpclb/grpclb_channel.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h", "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h",
], ],
external_deps = [ external_deps = [
"nanopb", "nanopb",
@ -791,7 +886,7 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc_lb_policy_pick_first", name = "grpc_lb_policy_pick_first",
srcs = [ srcs = [
"src/core/ext/lb_policy/pick_first/pick_first.c", "src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c",
], ],
language = "c", language = "c",
deps = [ deps = [
@ -803,7 +898,7 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc_lb_policy_round_robin", name = "grpc_lb_policy_round_robin",
srcs = [ srcs = [
"src/core/ext/lb_policy/round_robin/round_robin.c", "src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c",
], ],
language = "c", language = "c",
deps = [ deps = [
@ -815,12 +910,12 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc_load_reporting", name = "grpc_load_reporting",
srcs = [ srcs = [
"src/core/ext/load_reporting/load_reporting.c", "src/core/ext/filters/load_reporting/load_reporting.c",
"src/core/ext/load_reporting/load_reporting_filter.c", "src/core/ext/filters/load_reporting/load_reporting_filter.c",
], ],
hdrs = [ hdrs = [
"src/core/ext/load_reporting/load_reporting.h", "src/core/ext/filters/load_reporting/load_reporting.h",
"src/core/ext/load_reporting/load_reporting_filter.h", "src/core/ext/filters/load_reporting/load_reporting_filter.h",
], ],
language = "c", language = "c",
deps = [ deps = [
@ -831,7 +926,28 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc_resolver_dns_native", name = "grpc_resolver_dns_native",
srcs = [ srcs = [
"src/core/ext/resolver/dns/native/dns_resolver.c", "src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.c",
],
language = "c",
deps = [
"grpc_base",
"grpc_client_channel",
],
)
grpc_cc_library(
name = "grpc_resolver_dns_ares",
srcs = [
"src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c",
],
hdrs = [
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h",
"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h",
],
external_deps = [
"cares",
], ],
language = "c", language = "c",
deps = [ deps = [
@ -843,7 +959,7 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "grpc_resolver_sockaddr", name = "grpc_resolver_sockaddr",
srcs = [ srcs = [
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c", "src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c",
], ],
language = "c", language = "c",
deps = [ deps = [
@ -877,7 +993,6 @@ grpc_cc_library(
"src/core/lib/security/transport/security_handshaker.c", "src/core/lib/security/transport/security_handshaker.c",
"src/core/lib/security/transport/server_auth_filter.c", "src/core/lib/security/transport/server_auth_filter.c",
"src/core/lib/security/transport/tsi_error.c", "src/core/lib/security/transport/tsi_error.c",
"src/core/lib/security/util/b64.c",
"src/core/lib/security/util/json_util.c", "src/core/lib/security/util/json_util.c",
"src/core/lib/surface/init_secure.c", "src/core/lib/surface/init_secure.c",
], ],
@ -900,7 +1015,6 @@ grpc_cc_library(
"src/core/lib/security/transport/security_connector.h", "src/core/lib/security/transport/security_connector.h",
"src/core/lib/security/transport/security_handshaker.h", "src/core/lib/security/transport/security_handshaker.h",
"src/core/lib/security/transport/tsi_error.h", "src/core/lib/security/transport/tsi_error.h",
"src/core/lib/security/util/b64.h",
"src/core/lib/security/util/json_util.h", "src/core/lib/security/util/json_util.h",
], ],
language = "c", language = "c",
@ -930,6 +1044,7 @@ grpc_cc_library(
"src/core/ext/transport/chttp2/transport/hpack_encoder.c", "src/core/ext/transport/chttp2/transport/hpack_encoder.c",
"src/core/ext/transport/chttp2/transport/hpack_parser.c", "src/core/ext/transport/chttp2/transport/hpack_parser.c",
"src/core/ext/transport/chttp2/transport/hpack_table.c", "src/core/ext/transport/chttp2/transport/hpack_table.c",
"src/core/ext/transport/chttp2/transport/http2_settings.c",
"src/core/ext/transport/chttp2/transport/huffsyms.c", "src/core/ext/transport/chttp2/transport/huffsyms.c",
"src/core/ext/transport/chttp2/transport/incoming_metadata.c", "src/core/ext/transport/chttp2/transport/incoming_metadata.c",
"src/core/ext/transport/chttp2/transport/parsing.c", "src/core/ext/transport/chttp2/transport/parsing.c",
@ -952,6 +1067,7 @@ grpc_cc_library(
"src/core/ext/transport/chttp2/transport/hpack_encoder.h", "src/core/ext/transport/chttp2/transport/hpack_encoder.h",
"src/core/ext/transport/chttp2/transport/hpack_parser.h", "src/core/ext/transport/chttp2/transport/hpack_parser.h",
"src/core/ext/transport/chttp2/transport/hpack_table.h", "src/core/ext/transport/chttp2/transport/hpack_table.h",
"src/core/ext/transport/chttp2/transport/http2_settings.h",
"src/core/ext/transport/chttp2/transport/huffsyms.h", "src/core/ext/transport/chttp2/transport/huffsyms.h",
"src/core/ext/transport/chttp2/transport/incoming_metadata.h", "src/core/ext/transport/chttp2/transport/incoming_metadata.h",
"src/core/ext/transport/chttp2/transport/internal.h", "src/core/ext/transport/chttp2/transport/internal.h",
@ -962,6 +1078,7 @@ grpc_cc_library(
deps = [ deps = [
"grpc_base", "grpc_base",
"grpc_transport_chttp2_alpn", "grpc_transport_chttp2_alpn",
"grpc_http_filters",
], ],
) )
@ -1094,16 +1211,18 @@ grpc_cc_library(
grpc_cc_library( grpc_cc_library(
name = "tsi", name = "tsi",
srcs = [ srcs = [
"src/core/lib/tsi/fake_transport_security.c", "src/core/tsi/fake_transport_security.c",
"src/core/lib/tsi/ssl_transport_security.c", "src/core/tsi/ssl_transport_security.c",
"src/core/lib/tsi/transport_security.c", "src/core/tsi/transport_security.c",
"src/core/tsi/transport_security_adapter.c",
], ],
hdrs = [ hdrs = [
"src/core/lib/tsi/fake_transport_security.h", "src/core/tsi/fake_transport_security.h",
"src/core/lib/tsi/ssl_transport_security.h", "src/core/tsi/ssl_transport_security.h",
"src/core/lib/tsi/ssl_types.h", "src/core/tsi/ssl_types.h",
"src/core/lib/tsi/transport_security.h", "src/core/tsi/transport_security.h",
"src/core/lib/tsi/transport_security_interface.h", "src/core/tsi/transport_security_adapter.h",
"src/core/tsi/transport_security_interface.h",
], ],
external_deps = [ external_deps = [
"libssl", "libssl",
@ -1114,8 +1233,12 @@ grpc_cc_library(
], ],
) )
grpc_cc_library( grpc_cc_libraries(
name = "grpc++_base", name_list = ["grpc++_base", "grpc++_base_unsecure"],
additional_dep_list = [
["grpc", ],
["grpc_unsecure", ],
],
srcs = [ srcs = [
"src/cpp/client/channel_cc.cc", "src/cpp/client/channel_cc.cc",
"src/cpp/client/client_context.cc", "src/cpp/client/client_context.cc",
@ -1132,6 +1255,7 @@ grpc_cc_library(
"src/cpp/common/rpc_method.cc", "src/cpp/common/rpc_method.cc",
"src/cpp/common/version_cc.cc", "src/cpp/common/version_cc.cc",
"src/cpp/server/async_generic_service.cc", "src/cpp/server/async_generic_service.cc",
"src/cpp/server/channel_argument_option.cc",
"src/cpp/server/create_default_thread_pool.cc", "src/cpp/server/create_default_thread_pool.cc",
"src/cpp/server/dynamic_thread_pool.cc", "src/cpp/server/dynamic_thread_pool.cc",
"src/cpp/server/health/default_health_check_service.cc", "src/cpp/server/health/default_health_check_service.cc",
@ -1149,7 +1273,7 @@ grpc_cc_library(
"src/cpp/util/status.cc", "src/cpp/util/status.cc",
"src/cpp/util/string_ref.cc", "src/cpp/util/string_ref.cc",
"src/cpp/util/time_cc.cc", "src/cpp/util/time_cc.cc",
], ],
hdrs = [ hdrs = [
"src/cpp/client/create_channel_internal.h", "src/cpp/client/create_channel_internal.h",
"src/cpp/common/channel_filter.h", "src/cpp/common/channel_filter.h",
@ -1158,7 +1282,7 @@ grpc_cc_library(
"src/cpp/server/health/health.pb.h", "src/cpp/server/health/health.pb.h",
"src/cpp/server/thread_pool_interface.h", "src/cpp/server/thread_pool_interface.h",
"src/cpp/thread_manager/thread_manager.h", "src/cpp/thread_manager/thread_manager.h",
], ],
language = "c++", language = "c++",
public_hdrs = [ public_hdrs = [
"include/grpc++/alarm.h", "include/grpc++/alarm.h",
@ -1173,6 +1297,7 @@ grpc_cc_library(
"include/grpc++/grpc++.h", "include/grpc++/grpc++.h",
"include/grpc++/health_check_service_interface.h", "include/grpc++/health_check_service_interface.h",
"include/grpc++/impl/call.h", "include/grpc++/impl/call.h",
"include/grpc++/impl/channel_argument_option.h",
"include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/client_unary_call.h",
"include/grpc++/impl/codegen/core_codegen.h", "include/grpc++/impl/codegen/core_codegen.h",
"include/grpc++/impl/grpc_library.h", "include/grpc++/impl/grpc_library.h",
@ -1207,9 +1332,8 @@ grpc_cc_library(
"include/grpc++/support/stub_options.h", "include/grpc++/support/stub_options.h",
"include/grpc++/support/sync_stream.h", "include/grpc++/support/sync_stream.h",
"include/grpc++/support/time.h", "include/grpc++/support/time.h",
], ],
deps = [ deps = [
"grpc",
"grpc++_codegen_base", "grpc++_codegen_base",
], ],
) )
@ -1243,7 +1367,6 @@ grpc_cc_library(
"include/grpc++/impl/codegen/slice.h", "include/grpc++/impl/codegen/slice.h",
"include/grpc++/impl/codegen/status.h", "include/grpc++/impl/codegen/status.h",
"include/grpc++/impl/codegen/status_code_enum.h", "include/grpc++/impl/codegen/status_code_enum.h",
"include/grpc++/impl/codegen/status_helper.h",
"include/grpc++/impl/codegen/string_ref.h", "include/grpc++/impl/codegen/string_ref.h",
"include/grpc++/impl/codegen/stub_options.h", "include/grpc++/impl/codegen/stub_options.h",
"include/grpc++/impl/codegen/sync_stream.h", "include/grpc++/impl/codegen/sync_stream.h",
@ -1288,18 +1411,6 @@ grpc_cc_library(
], ],
) )
grpc_cc_library(
name = "thrift_util",
language = "c++",
public_hdrs = [
"include/grpc++/impl/codegen/thrift_serializer.h",
"include/grpc++/impl/codegen/thrift_utils.h",
],
deps = [
"grpc++_codegen_base",
],
)
grpc_cc_library( grpc_cc_library(
name = "grpc++_reflection", name = "grpc++_reflection",
srcs = [ srcs = [

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
#If you are in a hurry # If you are in a hurry
For language-specific installation instructions for gRPC runtime, please For language-specific installation instructions for gRPC runtime, please
refer to these documents refer to these documents
@ -14,25 +14,44 @@ refer to these documents
* [Ruby](src/ruby): `gem install grpc` * [Ruby](src/ruby): `gem install grpc`
#Pre-requisites # Pre-requisites
##Linux ## Linux
```sh ```sh
$ [sudo] apt-get install build-essential autoconf libtool $ [sudo] apt-get install build-essential autoconf libtool
``` ```
##Mac OSX If you plan to build from source and run tests, install the following as well:
```sh
$ [sudo] apt-get install libgflags-dev libgtest-dev
$ [sudo] apt-get install clang libc++-dev
```
## macOS
For a Mac system, git is not available by default. You will first need to On a Mac, you will first need to
install Xcode from the Mac AppStore and then run the following command from a install Xcode or
terminal: [Command Line Tools for Xcode](https://developer.apple.com/download/more/)
and then run the following command from a terminal:
```sh ```sh
$ [sudo] xcode-select --install $ [sudo] xcode-select --install
``` ```
##Protoc To build gRPC from source, you may also need to install the following
packages, which you can get from [Homebrew](https://brew.sh):
```sh
$ brew install autoconf automake libtool shtool
```
If you plan to build from source and run tests, install the following as well:
```sh
$ brew install gflags
```
## Protoc
By default gRPC uses [protocol buffers](https://github.com/google/protobuf), By default gRPC uses [protocol buffers](https://github.com/google/protobuf),
you will need the `protoc` compiler to generate stub server and client code. you will need the `protoc` compiler to generate stub server and client code.
@ -43,7 +62,7 @@ repository recursively and it detects that you don't already have it
installed. installed.
#Build from Source # Build from Source
For developers who are interested to contribute, here is how to compile the For developers who are interested to contribute, here is how to compile the
gRPC C Core library. gRPC C Core library.
@ -56,16 +75,16 @@ gRPC C Core library.
$ [sudo] make install $ [sudo] make install
``` ```
##Windows ## Windows
There are several ways to build under Windows, of varying complexity depending There are several ways to build under Windows, of varying complexity depending
on experience with the tools involved. on experience with the tools involved.
###Pre-generated Visual Studio solution ### Pre-generated Visual Studio solution
The pre-generated VS projects & solution are checked into the repository under the [vsprojects](/vsprojects) directory. The pre-generated VS projects & solution are checked into the repository under the [vsprojects](/vsprojects) directory.
###Building using CMake (with BoringSSL) ### Building using CMake (with BoringSSL)
- Install [CMake](https://cmake.org/download/). - Install [CMake](https://cmake.org/download/).
- Install [Active State Perl](http://www.activestate.com/activeperl/) (`choco install activeperl`) - Install [Active State Perl](http://www.activestate.com/activeperl/) (`choco install activeperl`)
- Install [Ninja](https://ninja-build.org/) (`choco install ninja`) - Install [Ninja](https://ninja-build.org/) (`choco install ninja`)
@ -81,14 +100,14 @@ The pre-generated VS projects & solution are checked into the repository under t
``` ```
NOTE: Currently you can only use Ninja to build using cmake on Windows (because of the boringssl dependency). NOTE: Currently you can only use Ninja to build using cmake on Windows (because of the boringssl dependency).
###msys2 (with mingw) ### msys2 (with mingw)
The Makefile (and source code) should support msys2's mingw32 and mingw64 The Makefile (and source code) should support msys2's mingw32 and mingw64
compilers. Building with msys2's native compiler is also possible, but compilers. Building with msys2's native compiler is also possible, but
difficult. difficult.
This approach requires having [msys2](https://msys2.github.io/) installed. This approach requires having [msys2](https://msys2.github.io/) installed.
``` ```
# Install prerequisites # Install prerequisites
MSYS2$ pacman -S autoconf automake gcc libtool mingw-w64-x86_64-toolchain perl pkg-config zlib MSYS2$ pacman -S autoconf automake gcc libtool mingw-w64-x86_64-toolchain perl pkg-config zlib

3436
Makefile

File diff suppressed because it is too large Load Diff

@ -7,6 +7,7 @@ graft include/grpc
graft third_party/boringssl graft third_party/boringssl
graft third_party/nanopb graft third_party/nanopb
graft third_party/zlib graft third_party/zlib
graft third_party/cares
include src/python/grpcio/_spawn_patch.py include src/python/grpcio/_spawn_patch.py
include src/python/grpcio/commands.py include src/python/grpcio/commands.py
include src/python/grpcio/grpc_version.py include src/python/grpcio/grpc_version.py
@ -16,3 +17,4 @@ include src/python/grpcio/support.py
include src/python/grpcio/README.rst include src/python/grpcio/README.rst
include requirements.txt include requirements.txt
include etc/roots.pem include etc/roots.pem
include Makefile

@ -7,11 +7,11 @@
Copyright 2015 Google Inc. Copyright 2015 Google Inc.
#Documentation # Documentation
You can find more detailed documentation and examples in the [doc](doc) and [examples](examples) directories respectively. You can find more detailed documentation and examples in the [doc](doc) and [examples](examples) directories respectively.
#Installation & Testing # Installation & Testing
See [INSTALL](INSTALL.md) for installation instructions for various platforms. See [INSTALL](INSTALL.md) for installation instructions for various platforms.
@ -19,32 +19,31 @@ See [tools/run_tests](tools/run_tests) for more guidance on how to run various t
See [Performance dashboard](http://performance-dot-grpc-testing.appspot.com/explore?dashboard=5712453606309888) for the performance numbers for v1.0.x. See [Performance dashboard](http://performance-dot-grpc-testing.appspot.com/explore?dashboard=5712453606309888) for the performance numbers for v1.0.x.
#Repository Structure & Status # Repository Structure & Status
This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library [src/core] (src/core). This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library [src/core](src/core).
Libraries in different languages may be in different states of development. We are seeking contributions for all of these libraries. Libraries in different languages may be in different states of development. We are seeking contributions for all of these libraries.
| Language | Source | Status | | Language | Source | Status |
|-------------------------|-------------------------------------|---------| |-------------------------|-------------------------------------|---------|
| Shared C [core library] | [src/core] (src/core) | 1.0 | | Shared C [core library] | [src/core](src/core) | 1.0 |
| C++ | [src/cpp] (src/cpp) | 1.0 | | C++ | [src/cpp](src/cpp) | 1.0 |
| Ruby | [src/ruby] (src/ruby) | 1.0 | | Ruby | [src/ruby](src/ruby) | 1.0 |
| NodeJS | [src/node] (src/node) | 1.0 | | NodeJS | [src/node](src/node) | 1.0 |
| Python | [src/python] (src/python) | 1.0 | | Python | [src/python](src/python) | 1.0 |
| PHP | [src/php] (src/php) | 1.0 | | PHP | [src/php](src/php) | 1.0 |
| C# | [src/csharp] (src/csharp) | 1.0 | | C# | [src/csharp](src/csharp) | 1.0 |
| Objective-C | [src/objective-c] (src/objective-c) | 1.0 | | Objective-C | [src/objective-c](src/objective-c) | 1.0 |
<small> Java source code is in the [grpc-java](http://github.com/grpc/grpc-java)
Java source code is in the [grpc-java] (http://github.com/grpc/grpc-java) repository. repository. Go source code is in the
Go source code is in the [grpc-go] (http://github.com/grpc/grpc-go) repository. [grpc-go](http://github.com/grpc/grpc-go) repository.
</small>
See [MANIFEST.md](MANIFEST.md) for a listing of top-level items in the See [MANIFEST.md](MANIFEST.md) for a listing of top-level items in the
repository. repository.
#Overview # Overview
Remote Procedure Calls (RPCs) provide a useful abstraction for building Remote Procedure Calls (RPCs) provide a useful abstraction for building
@ -54,7 +53,7 @@ These libraries enable communication between clients and servers using any
combination of the supported languages. combination of the supported languages.
##Interface ## Interface
Developers using gRPC typically start with the description of an RPC service Developers using gRPC typically start with the description of an RPC service
@ -66,7 +65,7 @@ Interface Definition Language (IDL) for describing both the service interface
and the structure of the payload messages. It is possible to use other and the structure of the payload messages. It is possible to use other
alternatives if desired. alternatives if desired.
###Surface API ### Surface API
Starting from an interface definition in a .proto file, gRPC provides Starting from an interface definition in a .proto file, gRPC provides
Protocol Compiler plugins that generate Client- and Server-side APIs. Protocol Compiler plugins that generate Client- and Server-side APIs.
gRPC users typically call into these APIs on the Client side and implement gRPC users typically call into these APIs on the Client side and implement
@ -94,7 +93,7 @@ the client and the server can send a stream of messages to each other. The strea
messages are delivered in the order they were sent. messages are delivered in the order they were sent.
#Protocol # Protocol
The [gRPC protocol](doc/PROTOCOL-HTTP2.md) specifies the abstract requirements for communication between The [gRPC protocol](doc/PROTOCOL-HTTP2.md) specifies the abstract requirements for communication between
clients and servers. A concrete embedding over HTTP/2 completes the picture by clients and servers. A concrete embedding over HTTP/2 completes the picture by

@ -12,7 +12,8 @@ load 'tools/distrib/docker_for_windows.rb'
# Add rubocop style checking tasks # Add rubocop style checking tasks
RuboCop::RakeTask.new(:rubocop) do |task| RuboCop::RakeTask.new(:rubocop) do |task|
task.options = ['-c', 'src/ruby/.rubocop.yml'] task.options = ['-c', 'src/ruby/.rubocop.yml']
task.patterns = ['src/ruby/{lib,spec}/**/*.rb'] # add end2end tests to formatter but don't add generated proto _pb.rb's
task.patterns = ['src/ruby/{lib,spec}/**/*.rb', 'src/ruby/end2end/*.rb']
end end
spec = Gem::Specification.load('grpc.gemspec') spec = Gem::Specification.load('grpc.gemspec')
@ -79,7 +80,7 @@ task 'dlls' do
grpc_config = ENV['GRPC_CONFIG'] || 'opt' grpc_config = ENV['GRPC_CONFIG'] || 'opt'
verbose = ENV['V'] || '0' verbose = ENV['V'] || '0'
env = 'CPPFLAGS="-D_WIN32_WINNT=0x600 -DUNICODE -D_UNICODE -Wno-unused-variable -Wno-unused-result" ' env = 'CPPFLAGS="-D_WIN32_WINNT=0x600 -DUNICODE -D_UNICODE -Wno-unused-variable -Wno-unused-result -DCARES_STATICLIB" '
env += 'LDFLAGS=-static ' env += 'LDFLAGS=-static '
env += 'SYSTEM=MINGW32 ' env += 'SYSTEM=MINGW32 '
env += 'EMBED_ZLIB=true ' env += 'EMBED_ZLIB=true '

@ -15,17 +15,22 @@ bind(
bind( bind(
name = "protobuf", name = "protobuf",
actual = "@submodule_protobuf//:protobuf", actual = "@com_google_protobuf//:protobuf",
) )
bind( bind(
name = "protobuf_clib", name = "protobuf_clib",
actual = "@submodule_protobuf//:protoc_lib", actual = "@com_google_protobuf//:protoc_lib",
) )
bind( bind(
name = "protocol_compiler", name = "protocol_compiler",
actual = "@submodule_protobuf//:protoc", actual = "@com_google_protobuf//:protoc",
)
bind(
name = "cares",
actual = "@submodule_cares//:ares",
) )
bind( bind(
@ -33,14 +38,18 @@ bind(
actual = "@submodule_gtest//:gtest", actual = "@submodule_gtest//:gtest",
) )
bind(
name = "benchmark",
actual = "@submodule_benchmark//:benchmark",
)
bind( bind(
name = "gflags", name = "gflags",
actual = "@com_github_gflags_gflags//:gflags", actual = "@com_github_gflags_gflags//:gflags",
) )
new_local_repository( local_repository(
name = "submodule_boringssl", name = "submodule_boringssl",
build_file = "third_party/boringssl-with-bazel/BUILD",
path = "third_party/boringssl-with-bazel", path = "third_party/boringssl-with-bazel",
) )
@ -51,7 +60,7 @@ new_local_repository(
) )
new_local_repository( new_local_repository(
name = "submodule_protobuf", name = "com_google_protobuf",
build_file = "third_party/protobuf/BUILD", build_file = "third_party/protobuf/BUILD",
path = "third_party/protobuf", path = "third_party/protobuf",
) )
@ -66,3 +75,15 @@ local_repository(
name = "com_github_gflags_gflags", name = "com_github_gflags_gflags",
path = "third_party/gflags", path = "third_party/gflags",
) )
new_local_repository(
name = "submodule_benchmark",
path = "third_party/benchmark",
build_file = "third_party/benchmark.BUILD",
)
new_local_repository(
name = "submodule_cares",
path = "third_party/cares",
build_file = "third_party/cares/cares.BUILD",
)

@ -35,12 +35,12 @@ load(":cc_grpc_library.bzl", "cc_grpc_library")
proto_library( proto_library(
name = "well_known_protos_list", name = "well_known_protos_list",
srcs = ["@submodule_protobuf//:well_known_protos"], srcs = ["@com_google_protobuf//:well_known_protos"],
) )
cc_grpc_library( cc_grpc_library(
name = "well_known_protos", name = "well_known_protos",
srcs = "well_known_protos_list", srcs = "well_known_protos_list",
deps = [],
proto_only = True, proto_only = True,
deps = [],
) )

@ -2,7 +2,7 @@
load("//:bazel/generate_cc.bzl", "generate_cc") load("//:bazel/generate_cc.bzl", "generate_cc")
def cc_grpc_library(name, srcs, deps, proto_only, **kwargs): def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, generate_mock, use_external = False, **kwargs):
"""Generates C++ grpc classes from a .proto file. """Generates C++ grpc classes from a .proto file.
Assumes the generated classes will be used in cc_api_version = 2. Assumes the generated classes will be used in cc_api_version = 2.
@ -12,6 +12,12 @@ def cc_grpc_library(name, srcs, deps, proto_only, **kwargs):
srcs: a single proto_library, which wraps the .proto files with services. srcs: a single proto_library, which wraps the .proto files with services.
deps: a list of C++ proto_library (or cc_proto_library) which provides deps: a list of C++ proto_library (or cc_proto_library) which provides
the compiled code of any message that the services depend on. the compiled code of any message that the services depend on.
well_known_protos: The target from protobuf library that exports well
known protos. Currently it will only work if the value is
"@com_google_protobuf//:well_known_protos"
use_external: When True the grpc deps are prefixed with //external. This
allows grpc to be used as a dependency in other bazel projects.
generate_mock: When true GMOCk code for client stub is generated.
**kwargs: rest of arguments, e.g., compatible_with and visibility. **kwargs: rest of arguments, e.g., compatible_with and visibility.
""" """
if len(srcs) > 1: if len(srcs) > 1:
@ -33,22 +39,38 @@ def cc_grpc_library(name, srcs, deps, proto_only, **kwargs):
generate_cc( generate_cc(
name = codegen_target, name = codegen_target,
srcs = [proto_target], srcs = [proto_target],
well_known_protos = well_known_protos,
**kwargs **kwargs
) )
if not proto_only: if not proto_only:
if use_external:
# when this file is used by non-grpc projects
plugin = "//external:grpc_cpp_plugin"
else:
plugin = "//:grpc_cpp_plugin"
generate_cc( generate_cc(
name = codegen_grpc_target, name = codegen_grpc_target,
srcs = [proto_target], srcs = [proto_target],
plugin = "//:grpc_cpp_plugin", plugin = plugin,
well_known_protos = well_known_protos,
generate_mock = generate_mock,
**kwargs **kwargs
) )
if use_external:
# when this file is used by non-grpc projects
grpc_deps = ["//external:grpc++", "//external:grpc++_codegen_proto",
"//external:protobuf"]
else:
grpc_deps = ["//:grpc++", "//:grpc++_codegen_proto", "//external:protobuf"]
native.cc_library( native.cc_library(
name = name, name = name,
srcs = [":" + codegen_grpc_target, ":" + codegen_target], srcs = [":" + codegen_grpc_target, ":" + codegen_target],
hdrs = [":" + codegen_grpc_target, ":" + codegen_target], hdrs = [":" + codegen_grpc_target, ":" + codegen_target],
deps = deps + ["//:grpc++", "//:grpc++_codegen_proto", "//external:protobuf"], deps = deps + grpc_deps,
**kwargs **kwargs
) )
else: else:

@ -9,21 +9,26 @@ def generate_cc_impl(ctx):
protos = [f for src in ctx.attr.srcs for f in src.proto.direct_sources] protos = [f for src in ctx.attr.srcs for f in src.proto.direct_sources]
includes = [f for src in ctx.attr.srcs for f in src.proto.transitive_imports] includes = [f for src in ctx.attr.srcs for f in src.proto.transitive_imports]
outs = [] outs = []
# label_len is length of the path from WORKSPACE root to the location of this build file
label_len = len(ctx.label.package) + 1
if ctx.executable.plugin: if ctx.executable.plugin:
outs += [proto.basename[:-len(".proto")] + ".grpc.pb.h" for proto in protos] outs += [proto.path[label_len:-len(".proto")] + ".grpc.pb.h" for proto in protos]
outs += [proto.basename[:-len(".proto")] + ".grpc.pb.cc" for proto in protos] outs += [proto.path[label_len:-len(".proto")] + ".grpc.pb.cc" for proto in protos]
if ctx.attr.generate_mock:
outs += [proto.path[label_len:-len(".proto")] + "_mock.grpc.pb.h" for proto in protos]
else: else:
outs += [proto.basename[:-len(".proto")] + ".pb.h" for proto in protos] outs += [proto.path[label_len:-len(".proto")] + ".pb.h" for proto in protos]
outs += [proto.basename[:-len(".proto")] + ".pb.cc" for proto in protos] outs += [proto.path[label_len:-len(".proto")] + ".pb.cc" for proto in protos]
out_files = [ctx.new_file(out) for out in outs] out_files = [ctx.new_file(out) for out in outs]
# The following should be replaced with ctx.configuration.buildout dir_out = str(ctx.genfiles_dir.path)
# whenever this is added to Skylark.
dir_out = out_files[0].dirname[:-len(protos[0].dirname)]
arguments = [] arguments = []
if ctx.executable.plugin: if ctx.executable.plugin:
arguments += ["--plugin=protoc-gen-PLUGIN=" + ctx.executable.plugin.path] arguments += ["--plugin=protoc-gen-PLUGIN=" + ctx.executable.plugin.path]
arguments += ["--PLUGIN_out=" + ",".join(ctx.attr.flags) + ":" + dir_out] flags = list(ctx.attr.flags)
if ctx.attr.generate_mock:
flags.append("generate_mock_code=true")
arguments += ["--PLUGIN_out=" + ",".join(flags) + ":" + dir_out]
additional_input = [ctx.executable.plugin] additional_input = [ctx.executable.plugin]
else: else:
arguments += ["--cpp_out=" + ",".join(ctx.attr.flags) + ":" + dir_out] arguments += ["--cpp_out=" + ",".join(ctx.attr.flags) + ":" + dir_out]
@ -31,8 +36,20 @@ def generate_cc_impl(ctx):
arguments += ["-I{0}={0}".format(include.path) for include in includes] arguments += ["-I{0}={0}".format(include.path) for include in includes]
arguments += [proto.path for proto in protos] arguments += [proto.path for proto in protos]
# create a list of well known proto files if the argument is non-None
well_known_proto_files = []
if ctx.attr.well_known_protos:
f = ctx.attr.well_known_protos.files.to_list()[0].dirname
if f != "external/com_google_protobuf/src/google/protobuf":
print("Error: Only @com_google_protobuf//:well_known_protos is supported")
else:
# f points to "external/com_google_protobuf/src/google/protobuf"
# add -I argument to protoc so it knows where to look for the proto files.
arguments += ["-I{0}".format(f + "/../..")]
well_known_proto_files = [f for f in ctx.attr.well_known_protos.files]
ctx.action( ctx.action(
inputs = protos + includes + additional_input, inputs = protos + includes + additional_input + well_known_proto_files,
outputs = out_files, outputs = out_files,
executable = ctx.executable._protoc, executable = ctx.executable._protoc,
arguments = arguments, arguments = arguments,
@ -56,6 +73,13 @@ generate_cc = rule(
mandatory = False, mandatory = False,
allow_empty = True, allow_empty = True,
), ),
"well_known_protos" : attr.label(
mandatory = False,
),
"generate_mock" : attr.bool(
default = False,
mandatory = False,
),
"_protoc": attr.label( "_protoc": attr.label(
default = Label("//external:protocol_compiler"), default = Label("//external:protocol_compiler"),
executable = True, executable = True,

@ -49,6 +49,22 @@ def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [], external_deps
] ]
) )
def grpc_cc_libraries(name_list, additional_src_list = [], additional_dep_list = [], srcs = [], public_hdrs = [], hdrs = [], external_deps = [], deps = [], standalone = False, language="C++"):
names = len(name_list)
asl = additional_src_list + [[]]*(names - len(additional_src_list))
adl = additional_dep_list + [[]]*(names - len(additional_dep_list))
for i in range(names):
grpc_cc_library(
name = name_list[i],
srcs = srcs + asl[i],
hdrs = hdrs,
public_hdrs = public_hdrs,
deps = deps + adl[i],
external_deps = external_deps,
standalone = standalone,
language = language
)
def grpc_proto_plugin(name, srcs = [], deps = []): def grpc_proto_plugin(name, srcs = [], deps = []):
native.cc_binary( native.cc_binary(
name = name, name = name,
@ -58,11 +74,15 @@ def grpc_proto_plugin(name, srcs = [], deps = []):
load("//:bazel/cc_grpc_library.bzl", "cc_grpc_library") load("//:bazel/cc_grpc_library.bzl", "cc_grpc_library")
def grpc_proto_library(name, srcs = [], deps = [], well_known_deps = [], has_services = True): def grpc_proto_library(name, srcs = [], deps = [], well_known_protos = None,
has_services = True, use_external = False, generate_mock = False):
cc_grpc_library( cc_grpc_library(
name = name, name = name,
srcs = srcs, srcs = srcs,
deps = deps, deps = deps,
well_known_protos = well_known_protos,
proto_only = not has_services, proto_only = not has_services,
use_external = use_external,
generate_mock = generate_mock,
) )

@ -39,24 +39,80 @@
{ {
'variables': { 'variables': {
'runtime%': 'node', 'runtime%': 'node',
# UV integration in C core is disabled by default while bugs are ironed # Some Node installations use the system installation of OpenSSL, and on
# out. It can be re-enabled for one build by setting the npm config # some systems, the system OpenSSL still does not have ALPN support. This
# variable grpc_uv to true, and it can be re-enabled permanently by # will let users recompile gRPC to work without ALPN.
# setting it to true here. 'grpc_alpn%': 'true',
'grpc_uv%': 'false' # Indicates that the library should be built with gcov.
'grpc_gcov%': 'false',
# Indicates that the library should be built with compatibility for musl
# libc, so that it can run on Alpine Linux. This is only necessary if not
# building on Alpine Linux
'grpc_alpine%': 'false'
}, },
'target_defaults': { 'target_defaults': {
'configurations': {
'Release': {
'cflags': [
'-O2',
],
'defines': [
'NDEBUG',
],
},
'Debug': {
'cflags': [
'-O0',
],
'defines': [
'_DEBUG',
'DEBUG',
],
},
},
'cflags': [
'-g',
'-Wall',
'-Wextra',
'-Werror',
'-Wno-long-long',
'-Wno-unused-parameter',
'-DOSATOMIC_USE_INLINED=1',
],
'ldflags': [
'-g',
],
'include_dirs': [ 'include_dirs': [
'.', '.',
'include' 'include'
], ],
'defines': [ 'defines': [
'GPR_BACKWARDS_COMPATIBILITY_MODE' 'GPR_BACKWARDS_COMPATIBILITY_MODE',
'GRPC_ARES=0',
'GRPC_UV'
], ],
'conditions': [ 'conditions': [
['grpc_uv=="true"', { ['grpc_gcov=="true"', {
'cflags': [
'-O0',
'-fprofile-arcs',
'-ftest-coverage',
'-Wno-return-type',
],
'defines': [ 'defines': [
'GRPC_UV' '_DEBUG',
'DEBUG',
'GPR_GCOV',
],
'ldflags': [
'-fprofile-arcs',
'-ftest-coverage',
'-rdynamic',
],
}],
['grpc_alpine=="true"', {
'defines': [
'GPR_MUSL_LIBC_COMPAT'
] ]
}], }],
['OS!="win" and runtime=="electron"', { ['OS!="win" and runtime=="electron"', {
@ -73,10 +129,16 @@
'OPENSSL_NO_ASM' 'OPENSSL_NO_ASM'
] ]
}, { }, {
# As of the beginning of 2017, we only support versions of Node with 'conditions': [
# embedded versions of OpenSSL that support ALPN ['grpc_alpn=="true"', {
'defines': [ 'defines': [
'TSI_OPENSSL_ALPN_SUPPORT=1' 'TSI_OPENSSL_ALPN_SUPPORT=1'
],
}, {
'defines': [
'TSI_OPENSSL_ALPN_SUPPORT=0'
],
}]
], ],
'include_dirs': [ 'include_dirs': [
'<(node_root_dir)/deps/openssl/openssl/include', '<(node_root_dir)/deps/openssl/openssl/include',
@ -95,7 +157,8 @@
}], }],
['OS == "win"', { ['OS == "win"', {
"include_dirs": [ "include_dirs": [
"third_party/zlib" "third_party/zlib",
"third_party/cares/cares"
], ],
"defines": [ "defines": [
'_WIN32_WINNT=0x0600', '_WIN32_WINNT=0x0600',
@ -114,25 +177,9 @@
"ws2_32" "ws2_32"
] ]
}, { # OS != "win" }, { # OS != "win"
'variables': {
'config': '<!(echo $CONFIG)',
},
'include_dirs': [ 'include_dirs': [
'<(node_root_dir)/deps/zlib' '<(node_root_dir)/deps/zlib',
], '<(node_root_dir)/deps/cares/include'
'conditions': [
['config=="gcov"', {
'cflags': [
'-ftest-coverage',
'-fprofile-arcs',
'-O0'
],
'ldflags': [
'-ftest-coverage',
'-fprofile-arcs'
]
}
]
] ]
}] }]
] ]
@ -460,7 +507,7 @@
}, },
] ]
}], }],
['OS == "win"', { ['OS == "win" and runtime!="electron"', {
'targets': [ 'targets': [
{ {
# IMPORTANT WINDOWS BUILD INFORMATION # IMPORTANT WINDOWS BUILD INFORMATION
@ -471,10 +518,13 @@
# when including the Node headers. The remedy for this is to remove # when including the Node headers. The remedy for this is to remove
# the OpenSSL headers, from the downloaded Node development package, # the OpenSSL headers, from the downloaded Node development package,
# which is typically located in `.node-gyp` in your home directory. # which is typically located in `.node-gyp` in your home directory.
#
# This is not true of Electron, which does not have OpenSSL headers.
'target_name': 'WINDOWS_BUILD_WARNING', 'target_name': 'WINDOWS_BUILD_WARNING',
'actions': [ 'rules': [
{ {
'action_name': 'WINDOWS_BUILD_WARNING', 'rule_name': 'WINDOWS_BUILD_WARNING',
'extension': 'S',
'inputs': [ 'inputs': [
'package.json' 'package.json'
], ],
@ -485,6 +535,10 @@
} }
] ]
}, },
]
}],
['OS == "win"', {
'targets': [
# Only want to compile zlib under Windows # Only want to compile zlib under Windows
{ {
'cflags': [ 'cflags': [
@ -534,6 +588,8 @@
'src/core/lib/profiling/basic_timers.c', 'src/core/lib/profiling/basic_timers.c',
'src/core/lib/profiling/stap_timers.c', 'src/core/lib/profiling/stap_timers.c',
'src/core/lib/support/alloc.c', 'src/core/lib/support/alloc.c',
'src/core/lib/support/arena.c',
'src/core/lib/support/atm.c',
'src/core/lib/support/avl.c', 'src/core/lib/support/avl.c',
'src/core/lib/support/backoff.c', 'src/core/lib/support/backoff.c',
'src/core/lib/support/cmdline.c', 'src/core/lib/support/cmdline.c',
@ -601,15 +657,10 @@
'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_args.c',
'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack.c',
'src/core/lib/channel/channel_stack_builder.c', 'src/core/lib/channel/channel_stack_builder.c',
'src/core/lib/channel/compress_filter.c',
'src/core/lib/channel/connected_channel.c', 'src/core/lib/channel/connected_channel.c',
'src/core/lib/channel/deadline_filter.c',
'src/core/lib/channel/handshaker.c', 'src/core/lib/channel/handshaker.c',
'src/core/lib/channel/handshaker_factory.c', 'src/core/lib/channel/handshaker_factory.c',
'src/core/lib/channel/handshaker_registry.c', 'src/core/lib/channel/handshaker_registry.c',
'src/core/lib/channel/http_client_filter.c',
'src/core/lib/channel/http_server_filter.c',
'src/core/lib/channel/message_size_filter.c',
'src/core/lib/compression/compression.c', 'src/core/lib/compression/compression.c',
'src/core/lib/compression/message_compress.c', 'src/core/lib/compression/message_compress.c',
'src/core/lib/debug/trace.c', 'src/core/lib/debug/trace.c',
@ -634,6 +685,7 @@
'src/core/lib/iomgr/iomgr_uv.c', 'src/core/lib/iomgr/iomgr_uv.c',
'src/core/lib/iomgr/iomgr_windows.c', 'src/core/lib/iomgr/iomgr_windows.c',
'src/core/lib/iomgr/load_file.c', 'src/core/lib/iomgr/load_file.c',
'src/core/lib/iomgr/lockfree_event.c',
'src/core/lib/iomgr/network_status_tracker.c', 'src/core/lib/iomgr/network_status_tracker.c',
'src/core/lib/iomgr/polling_entity.c', 'src/core/lib/iomgr/polling_entity.c',
'src/core/lib/iomgr/pollset_set_uv.c', 'src/core/lib/iomgr/pollset_set_uv.c',
@ -645,6 +697,7 @@
'src/core/lib/iomgr/resolve_address_windows.c', 'src/core/lib/iomgr/resolve_address_windows.c',
'src/core/lib/iomgr/resource_quota.c', 'src/core/lib/iomgr/resource_quota.c',
'src/core/lib/iomgr/sockaddr_utils.c', 'src/core/lib/iomgr/sockaddr_utils.c',
'src/core/lib/iomgr/socket_factory_posix.c',
'src/core/lib/iomgr/socket_mutator.c', 'src/core/lib/iomgr/socket_mutator.c',
'src/core/lib/iomgr/socket_utils_common_posix.c', 'src/core/lib/iomgr/socket_utils_common_posix.c',
'src/core/lib/iomgr/socket_utils_linux.c', 'src/core/lib/iomgr/socket_utils_linux.c',
@ -657,6 +710,9 @@
'src/core/lib/iomgr/tcp_client_windows.c', 'src/core/lib/iomgr/tcp_client_windows.c',
'src/core/lib/iomgr/tcp_posix.c', 'src/core/lib/iomgr/tcp_posix.c',
'src/core/lib/iomgr/tcp_server_posix.c', 'src/core/lib/iomgr/tcp_server_posix.c',
'src/core/lib/iomgr/tcp_server_utils_posix_common.c',
'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c',
'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c',
'src/core/lib/iomgr/tcp_server_uv.c', 'src/core/lib/iomgr/tcp_server_uv.c',
'src/core/lib/iomgr/tcp_server_windows.c', 'src/core/lib/iomgr/tcp_server_windows.c',
'src/core/lib/iomgr/tcp_uv.c', 'src/core/lib/iomgr/tcp_uv.c',
@ -679,6 +735,7 @@
'src/core/lib/json/json_reader.c', 'src/core/lib/json/json_reader.c',
'src/core/lib/json/json_string.c', 'src/core/lib/json/json_string.c',
'src/core/lib/json/json_writer.c', 'src/core/lib/json/json_writer.c',
'src/core/lib/slice/b64.c',
'src/core/lib/slice/percent_encoding.c', 'src/core/lib/slice/percent_encoding.c',
'src/core/lib/slice/slice.c', 'src/core/lib/slice/slice.c',
'src/core/lib/slice/slice_buffer.c', 'src/core/lib/slice/slice_buffer.c',
@ -697,8 +754,9 @@
'src/core/lib/surface/channel_ping.c', 'src/core/lib/surface/channel_ping.c',
'src/core/lib/surface/channel_stack_type.c', 'src/core/lib/surface/channel_stack_type.c',
'src/core/lib/surface/completion_queue.c', 'src/core/lib/surface/completion_queue.c',
'src/core/lib/surface/completion_queue_factory.c',
'src/core/lib/surface/event_string.c', 'src/core/lib/surface/event_string.c',
'src/core/lib/surface/lame_client.c', 'src/core/lib/surface/lame_client.cc',
'src/core/lib/surface/metadata_array.c', 'src/core/lib/surface/metadata_array.c',
'src/core/lib/surface/server.c', 'src/core/lib/surface/server.c',
'src/core/lib/surface/validate_metadata.c', 'src/core/lib/surface/validate_metadata.c',
@ -730,6 +788,7 @@
'src/core/ext/transport/chttp2/transport/hpack_encoder.c', 'src/core/ext/transport/chttp2/transport/hpack_encoder.c',
'src/core/ext/transport/chttp2/transport/hpack_parser.c', 'src/core/ext/transport/chttp2/transport/hpack_parser.c',
'src/core/ext/transport/chttp2/transport/hpack_table.c', 'src/core/ext/transport/chttp2/transport/hpack_table.c',
'src/core/ext/transport/chttp2/transport/http2_settings.c',
'src/core/ext/transport/chttp2/transport/huffsyms.c', 'src/core/ext/transport/chttp2/transport/huffsyms.c',
'src/core/ext/transport/chttp2/transport/incoming_metadata.c', 'src/core/ext/transport/chttp2/transport/incoming_metadata.c',
'src/core/ext/transport/chttp2/transport/parsing.c', 'src/core/ext/transport/chttp2/transport/parsing.c',
@ -738,6 +797,10 @@
'src/core/ext/transport/chttp2/transport/varint.c', 'src/core/ext/transport/chttp2/transport/varint.c',
'src/core/ext/transport/chttp2/transport/writing.c', 'src/core/ext/transport/chttp2/transport/writing.c',
'src/core/ext/transport/chttp2/alpn/alpn.c', 'src/core/ext/transport/chttp2/alpn/alpn.c',
'src/core/ext/filters/http/client/http_client_filter.c',
'src/core/ext/filters/http/http_filters_plugin.c',
'src/core/ext/filters/http/message_compress/message_compress_filter.c',
'src/core/ext/filters/http/server/http_server_filter.c',
'src/core/lib/http/httpcli_security_connector.c', 'src/core/lib/http/httpcli_security_connector.c',
'src/core/lib/security/context/security_context.c', 'src/core/lib/security/context/security_context.c',
'src/core/lib/security/credentials/composite/composite_credentials.c', 'src/core/lib/security/credentials/composite/composite_credentials.c',
@ -760,53 +823,58 @@
'src/core/lib/security/transport/security_handshaker.c', 'src/core/lib/security/transport/security_handshaker.c',
'src/core/lib/security/transport/server_auth_filter.c', 'src/core/lib/security/transport/server_auth_filter.c',
'src/core/lib/security/transport/tsi_error.c', 'src/core/lib/security/transport/tsi_error.c',
'src/core/lib/security/util/b64.c',
'src/core/lib/security/util/json_util.c', 'src/core/lib/security/util/json_util.c',
'src/core/lib/surface/init_secure.c', 'src/core/lib/surface/init_secure.c',
'src/core/lib/tsi/fake_transport_security.c', 'src/core/tsi/fake_transport_security.c',
'src/core/lib/tsi/ssl_transport_security.c', 'src/core/tsi/ssl_transport_security.c',
'src/core/lib/tsi/transport_security.c', 'src/core/tsi/transport_security.c',
'src/core/tsi/transport_security_adapter.c',
'src/core/ext/transport/chttp2/server/chttp2_server.c', 'src/core/ext/transport/chttp2/server/chttp2_server.c',
'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c', 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c',
'src/core/ext/client_channel/channel_connectivity.c', 'src/core/ext/filters/client_channel/channel_connectivity.c',
'src/core/ext/client_channel/client_channel.c', 'src/core/ext/filters/client_channel/client_channel.c',
'src/core/ext/client_channel/client_channel_factory.c', 'src/core/ext/filters/client_channel/client_channel_factory.c',
'src/core/ext/client_channel/client_channel_plugin.c', 'src/core/ext/filters/client_channel/client_channel_plugin.c',
'src/core/ext/client_channel/connector.c', 'src/core/ext/filters/client_channel/connector.c',
'src/core/ext/client_channel/default_initial_connect_string.c', 'src/core/ext/filters/client_channel/http_connect_handshaker.c',
'src/core/ext/client_channel/http_connect_handshaker.c', 'src/core/ext/filters/client_channel/http_proxy.c',
'src/core/ext/client_channel/http_proxy.c', 'src/core/ext/filters/client_channel/lb_policy.c',
'src/core/ext/client_channel/initial_connect_string.c', 'src/core/ext/filters/client_channel/lb_policy_factory.c',
'src/core/ext/client_channel/lb_policy.c', 'src/core/ext/filters/client_channel/lb_policy_registry.c',
'src/core/ext/client_channel/lb_policy_factory.c', 'src/core/ext/filters/client_channel/parse_address.c',
'src/core/ext/client_channel/lb_policy_registry.c', 'src/core/ext/filters/client_channel/proxy_mapper.c',
'src/core/ext/client_channel/parse_address.c', 'src/core/ext/filters/client_channel/proxy_mapper_registry.c',
'src/core/ext/client_channel/proxy_mapper.c', 'src/core/ext/filters/client_channel/resolver.c',
'src/core/ext/client_channel/proxy_mapper_registry.c', 'src/core/ext/filters/client_channel/resolver_factory.c',
'src/core/ext/client_channel/resolver.c', 'src/core/ext/filters/client_channel/resolver_registry.c',
'src/core/ext/client_channel/resolver_factory.c', 'src/core/ext/filters/client_channel/retry_throttle.c',
'src/core/ext/client_channel/resolver_registry.c', 'src/core/ext/filters/client_channel/subchannel.c',
'src/core/ext/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel_index.c',
'src/core/ext/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/uri_parser.c',
'src/core/ext/client_channel/uri_parser.c', 'src/core/ext/filters/deadline/deadline_filter.c',
'src/core/ext/transport/chttp2/client/chttp2_connector.c', 'src/core/ext/transport/chttp2/client/chttp2_connector.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c',
'src/core/ext/lb_policy/grpclb/grpclb.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c',
'src/core/ext/lb_policy/grpclb/grpclb_channel_secure.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c',
'src/core/ext/lb_policy/grpclb/load_balancer_api.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.c',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
'third_party/nanopb/pb_common.c', 'third_party/nanopb/pb_common.c',
'third_party/nanopb/pb_decode.c', 'third_party/nanopb/pb_decode.c',
'third_party/nanopb/pb_encode.c', 'third_party/nanopb/pb_encode.c',
'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c',
'src/core/ext/resolver/dns/native/dns_resolver.c', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c',
'src/core/ext/load_reporting/load_reporting.c', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c',
'src/core/ext/load_reporting/load_reporting_filter.c', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.c',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/filters/load_reporting/load_reporting.c',
'src/core/ext/filters/load_reporting/load_reporting_filter.c',
'src/core/ext/census/base_resources.c', 'src/core/ext/census/base_resources.c',
'src/core/ext/census/context.c', 'src/core/ext/census/context.c',
'src/core/ext/census/gen/census.pb.c', 'src/core/ext/census/gen/census.pb.c',
@ -821,6 +889,8 @@
'src/core/ext/census/resource.c', 'src/core/ext/census/resource.c',
'src/core/ext/census/trace_context.c', 'src/core/ext/census/trace_context.c',
'src/core/ext/census/tracing.c', 'src/core/ext/census/tracing.c',
'src/core/ext/filters/max_age/max_age_filter.c',
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/plugin_registry/grpc_plugin_registry.c', 'src/core/plugin_registry/grpc_plugin_registry.c',
], ],
"conditions": [ "conditions": [
@ -837,16 +907,10 @@
], ],
'cflags': [ 'cflags': [
'-std=c++11', '-std=c++11',
'-Wall',
'-pthread', '-pthread',
'-g',
'-zdefs', '-zdefs',
'-Werror',
'-Wno-error=deprecated-declarations' '-Wno-error=deprecated-declarations'
], ],
'ldflags': [
'-g'
],
"conditions": [ "conditions": [
['OS=="win" or runtime=="electron"', { ['OS=="win" or runtime=="electron"', {
'dependencies': [ 'dependencies': [
@ -880,13 +944,10 @@
"src/node/ext/call_credentials.cc", "src/node/ext/call_credentials.cc",
"src/node/ext/channel.cc", "src/node/ext/channel.cc",
"src/node/ext/channel_credentials.cc", "src/node/ext/channel_credentials.cc",
"src/node/ext/completion_queue_threadpool.cc", "src/node/ext/completion_queue.cc",
"src/node/ext/completion_queue_uv.cc",
"src/node/ext/node_grpc.cc", "src/node/ext/node_grpc.cc",
"src/node/ext/server.cc", "src/node/ext/server.cc",
"src/node/ext/server_credentials.cc", "src/node/ext/server_credentials.cc",
"src/node/ext/server_generic.cc",
"src/node/ext/server_uv.cc",
"src/node/ext/slice.cc", "src/node/ext/slice.cc",
"src/node/ext/timeval.cc", "src/node/ext/timeval.cc",
], ],

File diff suppressed because it is too large Load Diff

@ -28,5 +28,5 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
module GrpcBuildConfig module GrpcBuildConfig
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-3.dll' CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-4.dll'
end end

@ -3,6 +3,8 @@ option(gRPC_MSVC_STATIC_RUNTIME "Link with static msvc runtime libraries" OFF)
if(gRPC_MSVC_STATIC_RUNTIME) if(gRPC_MSVC_STATIC_RUNTIME)
# switch from dynamic to static linking of msvcrt # switch from dynamic to static linking of msvcrt
foreach(flag_var foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)

@ -8,6 +8,8 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/include)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/cares)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/cares/cares)
LIBS="-lpthread $LIBS" LIBS="-lpthread $LIBS"
@ -18,8 +20,11 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_LIBRARY(dl) PHP_ADD_LIBRARY(dl)
case $host in case $host in
*darwin*) ;; *darwin*)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/cares/config_darwin)
;;
*) *)
PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/cares/config_linux)
PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD) PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD)
PHP_ADD_LIBRARY(rt) PHP_ADD_LIBRARY(rt)
;; ;;
@ -39,6 +44,8 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/profiling/basic_timers.c \ src/core/lib/profiling/basic_timers.c \
src/core/lib/profiling/stap_timers.c \ src/core/lib/profiling/stap_timers.c \
src/core/lib/support/alloc.c \ src/core/lib/support/alloc.c \
src/core/lib/support/arena.c \
src/core/lib/support/atm.c \
src/core/lib/support/avl.c \ src/core/lib/support/avl.c \
src/core/lib/support/backoff.c \ src/core/lib/support/backoff.c \
src/core/lib/support/cmdline.c \ src/core/lib/support/cmdline.c \
@ -84,15 +91,10 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.c \
src/core/lib/channel/compress_filter.c \
src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.c \
src/core/lib/channel/deadline_filter.c \
src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.c \
src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.c \
src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.c \
src/core/lib/channel/http_client_filter.c \
src/core/lib/channel/http_server_filter.c \
src/core/lib/channel/message_size_filter.c \
src/core/lib/compression/compression.c \ src/core/lib/compression/compression.c \
src/core/lib/compression/message_compress.c \ src/core/lib/compression/message_compress.c \
src/core/lib/debug/trace.c \ src/core/lib/debug/trace.c \
@ -117,6 +119,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/iomgr/iomgr_uv.c \ src/core/lib/iomgr/iomgr_uv.c \
src/core/lib/iomgr/iomgr_windows.c \ src/core/lib/iomgr/iomgr_windows.c \
src/core/lib/iomgr/load_file.c \ src/core/lib/iomgr/load_file.c \
src/core/lib/iomgr/lockfree_event.c \
src/core/lib/iomgr/network_status_tracker.c \ src/core/lib/iomgr/network_status_tracker.c \
src/core/lib/iomgr/polling_entity.c \ src/core/lib/iomgr/polling_entity.c \
src/core/lib/iomgr/pollset_set_uv.c \ src/core/lib/iomgr/pollset_set_uv.c \
@ -128,6 +131,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/iomgr/resolve_address_windows.c \ src/core/lib/iomgr/resolve_address_windows.c \
src/core/lib/iomgr/resource_quota.c \ src/core/lib/iomgr/resource_quota.c \
src/core/lib/iomgr/sockaddr_utils.c \ src/core/lib/iomgr/sockaddr_utils.c \
src/core/lib/iomgr/socket_factory_posix.c \
src/core/lib/iomgr/socket_mutator.c \ src/core/lib/iomgr/socket_mutator.c \
src/core/lib/iomgr/socket_utils_common_posix.c \ src/core/lib/iomgr/socket_utils_common_posix.c \
src/core/lib/iomgr/socket_utils_linux.c \ src/core/lib/iomgr/socket_utils_linux.c \
@ -140,6 +144,9 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/iomgr/tcp_client_windows.c \ src/core/lib/iomgr/tcp_client_windows.c \
src/core/lib/iomgr/tcp_posix.c \ src/core/lib/iomgr/tcp_posix.c \
src/core/lib/iomgr/tcp_server_posix.c \ src/core/lib/iomgr/tcp_server_posix.c \
src/core/lib/iomgr/tcp_server_utils_posix_common.c \
src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c \
src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c \
src/core/lib/iomgr/tcp_server_uv.c \ src/core/lib/iomgr/tcp_server_uv.c \
src/core/lib/iomgr/tcp_server_windows.c \ src/core/lib/iomgr/tcp_server_windows.c \
src/core/lib/iomgr/tcp_uv.c \ src/core/lib/iomgr/tcp_uv.c \
@ -162,6 +169,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/json/json_reader.c \ src/core/lib/json/json_reader.c \
src/core/lib/json/json_string.c \ src/core/lib/json/json_string.c \
src/core/lib/json/json_writer.c \ src/core/lib/json/json_writer.c \
src/core/lib/slice/b64.c \
src/core/lib/slice/percent_encoding.c \ src/core/lib/slice/percent_encoding.c \
src/core/lib/slice/slice.c \ src/core/lib/slice/slice.c \
src/core/lib/slice/slice_buffer.c \ src/core/lib/slice/slice_buffer.c \
@ -180,8 +188,9 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/surface/channel_ping.c \ src/core/lib/surface/channel_ping.c \
src/core/lib/surface/channel_stack_type.c \ src/core/lib/surface/channel_stack_type.c \
src/core/lib/surface/completion_queue.c \ src/core/lib/surface/completion_queue.c \
src/core/lib/surface/completion_queue_factory.c \
src/core/lib/surface/event_string.c \ src/core/lib/surface/event_string.c \
src/core/lib/surface/lame_client.c \ src/core/lib/surface/lame_client.cc \
src/core/lib/surface/metadata_array.c \ src/core/lib/surface/metadata_array.c \
src/core/lib/surface/server.c \ src/core/lib/surface/server.c \
src/core/lib/surface/validate_metadata.c \ src/core/lib/surface/validate_metadata.c \
@ -213,6 +222,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/transport/chttp2/transport/hpack_encoder.c \ src/core/ext/transport/chttp2/transport/hpack_encoder.c \
src/core/ext/transport/chttp2/transport/hpack_parser.c \ src/core/ext/transport/chttp2/transport/hpack_parser.c \
src/core/ext/transport/chttp2/transport/hpack_table.c \ src/core/ext/transport/chttp2/transport/hpack_table.c \
src/core/ext/transport/chttp2/transport/http2_settings.c \
src/core/ext/transport/chttp2/transport/huffsyms.c \ src/core/ext/transport/chttp2/transport/huffsyms.c \
src/core/ext/transport/chttp2/transport/incoming_metadata.c \ src/core/ext/transport/chttp2/transport/incoming_metadata.c \
src/core/ext/transport/chttp2/transport/parsing.c \ src/core/ext/transport/chttp2/transport/parsing.c \
@ -221,6 +231,10 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/transport/writing.c \
src/core/ext/transport/chttp2/alpn/alpn.c \ src/core/ext/transport/chttp2/alpn/alpn.c \
src/core/ext/filters/http/client/http_client_filter.c \
src/core/ext/filters/http/http_filters_plugin.c \
src/core/ext/filters/http/message_compress/message_compress_filter.c \
src/core/ext/filters/http/server/http_server_filter.c \
src/core/lib/http/httpcli_security_connector.c \ src/core/lib/http/httpcli_security_connector.c \
src/core/lib/security/context/security_context.c \ src/core/lib/security/context/security_context.c \
src/core/lib/security/credentials/composite/composite_credentials.c \ src/core/lib/security/credentials/composite/composite_credentials.c \
@ -243,53 +257,58 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/security/transport/security_handshaker.c \ src/core/lib/security/transport/security_handshaker.c \
src/core/lib/security/transport/server_auth_filter.c \ src/core/lib/security/transport/server_auth_filter.c \
src/core/lib/security/transport/tsi_error.c \ src/core/lib/security/transport/tsi_error.c \
src/core/lib/security/util/b64.c \
src/core/lib/security/util/json_util.c \ src/core/lib/security/util/json_util.c \
src/core/lib/surface/init_secure.c \ src/core/lib/surface/init_secure.c \
src/core/lib/tsi/fake_transport_security.c \ src/core/tsi/fake_transport_security.c \
src/core/lib/tsi/ssl_transport_security.c \ src/core/tsi/ssl_transport_security.c \
src/core/lib/tsi/transport_security.c \ src/core/tsi/transport_security.c \
src/core/tsi/transport_security_adapter.c \
src/core/ext/transport/chttp2/server/chttp2_server.c \ src/core/ext/transport/chttp2/server/chttp2_server.c \
src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \ src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \
src/core/ext/client_channel/channel_connectivity.c \ src/core/ext/filters/client_channel/channel_connectivity.c \
src/core/ext/client_channel/client_channel.c \ src/core/ext/filters/client_channel/client_channel.c \
src/core/ext/client_channel/client_channel_factory.c \ src/core/ext/filters/client_channel/client_channel_factory.c \
src/core/ext/client_channel/client_channel_plugin.c \ src/core/ext/filters/client_channel/client_channel_plugin.c \
src/core/ext/client_channel/connector.c \ src/core/ext/filters/client_channel/connector.c \
src/core/ext/client_channel/default_initial_connect_string.c \ src/core/ext/filters/client_channel/http_connect_handshaker.c \
src/core/ext/client_channel/http_connect_handshaker.c \ src/core/ext/filters/client_channel/http_proxy.c \
src/core/ext/client_channel/http_proxy.c \ src/core/ext/filters/client_channel/lb_policy.c \
src/core/ext/client_channel/initial_connect_string.c \ src/core/ext/filters/client_channel/lb_policy_factory.c \
src/core/ext/client_channel/lb_policy.c \ src/core/ext/filters/client_channel/lb_policy_registry.c \
src/core/ext/client_channel/lb_policy_factory.c \ src/core/ext/filters/client_channel/parse_address.c \
src/core/ext/client_channel/lb_policy_registry.c \ src/core/ext/filters/client_channel/proxy_mapper.c \
src/core/ext/client_channel/parse_address.c \ src/core/ext/filters/client_channel/proxy_mapper_registry.c \
src/core/ext/client_channel/proxy_mapper.c \ src/core/ext/filters/client_channel/resolver.c \
src/core/ext/client_channel/proxy_mapper_registry.c \ src/core/ext/filters/client_channel/resolver_factory.c \
src/core/ext/client_channel/resolver.c \ src/core/ext/filters/client_channel/resolver_registry.c \
src/core/ext/client_channel/resolver_factory.c \ src/core/ext/filters/client_channel/retry_throttle.c \
src/core/ext/client_channel/resolver_registry.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/uri_parser.c \
src/core/ext/client_channel/uri_parser.c \ src/core/ext/filters/deadline/deadline_filter.c \
src/core/ext/transport/chttp2/client/chttp2_connector.c \ src/core/ext/transport/chttp2/client/chttp2_connector.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c \
src/core/ext/lb_policy/grpclb/grpclb.c \ src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c \
src/core/ext/lb_policy/grpclb/grpclb_channel_secure.c \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c \
src/core/ext/lb_policy/grpclb/load_balancer_api.c \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.c \
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c \
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c \
src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c \
third_party/nanopb/pb_common.c \ third_party/nanopb/pb_common.c \
third_party/nanopb/pb_decode.c \ third_party/nanopb/pb_decode.c \
third_party/nanopb/pb_encode.c \ third_party/nanopb/pb_encode.c \
src/core/ext/lb_policy/pick_first/pick_first.c \ src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \ src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c \
src/core/ext/resolver/dns/native/dns_resolver.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \
src/core/ext/load_reporting/load_reporting.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c \
src/core/ext/load_reporting/load_reporting_filter.c \ src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.c \
src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/filters/load_reporting/load_reporting.c \
src/core/ext/filters/load_reporting/load_reporting_filter.c \
src/core/ext/census/base_resources.c \ src/core/ext/census/base_resources.c \
src/core/ext/census/context.c \ src/core/ext/census/context.c \
src/core/ext/census/gen/census.pb.c \ src/core/ext/census/gen/census.pb.c \
@ -304,6 +323,8 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/census/resource.c \ src/core/ext/census/resource.c \
src/core/ext/census/trace_context.c \ src/core/ext/census/trace_context.c \
src/core/ext/census/tracing.c \ src/core/ext/census/tracing.c \
src/core/ext/filters/max_age/max_age_filter.c \
src/core/ext/filters/message_size/message_size_filter.c \
src/core/plugin_registry/grpc_plugin_registry.c \ src/core/plugin_registry/grpc_plugin_registry.c \
src/boringssl/err_data.c \ src/boringssl/err_data.c \
third_party/boringssl/crypto/aes/aes.c \ third_party/boringssl/crypto/aes/aes.c \
@ -609,6 +630,55 @@ if test "$PHP_GRPC" != "no"; then
third_party/boringssl/ssl/tls13_server.c \ third_party/boringssl/ssl/tls13_server.c \
third_party/boringssl/ssl/tls_method.c \ third_party/boringssl/ssl/tls_method.c \
third_party/boringssl/ssl/tls_record.c \ third_party/boringssl/ssl/tls_record.c \
third_party/cares/cares/ares__close_sockets.c \
third_party/cares/cares/ares__get_hostent.c \
third_party/cares/cares/ares__read_line.c \
third_party/cares/cares/ares__timeval.c \
third_party/cares/cares/ares_cancel.c \
third_party/cares/cares/ares_create_query.c \
third_party/cares/cares/ares_data.c \
third_party/cares/cares/ares_destroy.c \
third_party/cares/cares/ares_expand_name.c \
third_party/cares/cares/ares_expand_string.c \
third_party/cares/cares/ares_fds.c \
third_party/cares/cares/ares_free_hostent.c \
third_party/cares/cares/ares_free_string.c \
third_party/cares/cares/ares_getenv.c \
third_party/cares/cares/ares_gethostbyaddr.c \
third_party/cares/cares/ares_gethostbyname.c \
third_party/cares/cares/ares_getnameinfo.c \
third_party/cares/cares/ares_getopt.c \
third_party/cares/cares/ares_getsock.c \
third_party/cares/cares/ares_init.c \
third_party/cares/cares/ares_library_init.c \
third_party/cares/cares/ares_llist.c \
third_party/cares/cares/ares_mkquery.c \
third_party/cares/cares/ares_nowarn.c \
third_party/cares/cares/ares_options.c \
third_party/cares/cares/ares_parse_a_reply.c \
third_party/cares/cares/ares_parse_aaaa_reply.c \
third_party/cares/cares/ares_parse_mx_reply.c \
third_party/cares/cares/ares_parse_naptr_reply.c \
third_party/cares/cares/ares_parse_ns_reply.c \
third_party/cares/cares/ares_parse_ptr_reply.c \
third_party/cares/cares/ares_parse_soa_reply.c \
third_party/cares/cares/ares_parse_srv_reply.c \
third_party/cares/cares/ares_parse_txt_reply.c \
third_party/cares/cares/ares_platform.c \
third_party/cares/cares/ares_process.c \
third_party/cares/cares/ares_query.c \
third_party/cares/cares/ares_search.c \
third_party/cares/cares/ares_send.c \
third_party/cares/cares/ares_strcasecmp.c \
third_party/cares/cares/ares_strdup.c \
third_party/cares/cares/ares_strerror.c \
third_party/cares/cares/ares_timeout.c \
third_party/cares/cares/ares_version.c \
third_party/cares/cares/ares_writev.c \
third_party/cares/cares/bitncmp.c \
third_party/cares/cares/inet_net_pton.c \
third_party/cares/cares/inet_ntop.c \
third_party/cares/cares/windows_port.c \
, $ext_shared, , -Wall -Werror \ , $ext_shared, , -Wall -Werror \
-Wno-parentheses-equality -Wno-unused-value -std=c11 \ -Wno-parentheses-equality -Wno-unused-value -std=c11 \
-fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN \ -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN \
@ -619,14 +689,22 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl) PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census/gen) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census/gen)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/client_channel) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/pick_first) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/pick_first)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/round_robin) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/lb_policy/round_robin)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/load_reporting) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/c_ares)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/resolver/dns/native) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/resolver/sockaddr) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/sockaddr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/deadline)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/client)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/message_compress)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/server)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/load_reporting)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/max_age)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/message_size)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/alpn) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/alpn)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure)
@ -658,8 +736,8 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/support) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/support)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/surface) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/surface)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/transport) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/transport)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/tsi)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/plugin_registry) PHP_ADD_BUILD_DIR($ext_builddir/src/core/plugin_registry)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/aes) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/aes)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/asn1) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/asn1)
@ -703,5 +781,6 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509v3) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509v3)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl) PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/cares/cares)
PHP_ADD_BUILD_DIR($ext_builddir/third_party/nanopb) PHP_ADD_BUILD_DIR($ext_builddir/third_party/nanopb)
fi fi

@ -91,7 +91,7 @@ A **Compressed-Flag** value of 1 indicates that the binary octet sequence of **M
For requests, **EOS** (end-of-stream) is indicated by the presence of the END_STREAM flag on the last received DATA frame. In scenarios where the **Request** stream needs to be closed but no data remains to be sent implementations MUST send an empty DATA frame with this flag set. For requests, **EOS** (end-of-stream) is indicated by the presence of the END_STREAM flag on the last received DATA frame. In scenarios where the **Request** stream needs to be closed but no data remains to be sent implementations MUST send an empty DATA frame with this flag set.
###Responses ### Responses
* **Response** → (Response-Headers \*Length-Prefixed-Message Trailers) / Trailers-Only * **Response** → (Response-Headers \*Length-Prefixed-Message Trailers) / Trailers-Only
* **Response-Headers** → HTTP-Status [Message-Encoding] [Message-Accept-Encoding] Content-Type \*Custom-Metadata * **Response-Headers** → HTTP-Status [Message-Encoding] [Message-Accept-Encoding] Content-Type \*Custom-Metadata
@ -128,7 +128,7 @@ implementation can decode valid portions while leaving broken %-encodings as-is
or replacing them with a replacement character (e.g., '?' or the Unicode or replacing them with a replacement character (e.g., '?' or the Unicode
replacement character). replacement character).
####Example #### Example
Sample unary-call showing HTTP2 framing sequence Sample unary-call showing HTTP2 framing sequence
@ -162,7 +162,7 @@ HEADERS (flags = END_STREAM, END_HEADERS)
grpc-status = 0 # OK grpc-status = 0 # OK
trace-proto-bin = jher831yy13JHy3hc trace-proto-bin = jher831yy13JHy3hc
``` ```
####User Agents #### User Agents
While the protocol does not require a user-agent to function it is recommended that clients provide a structured user-agent string that provides a basic description of the calling library, version & platform to facilitate issue diagnosis in heterogeneous environments. The following structure is recommended to library developers While the protocol does not require a user-agent to function it is recommended that clients provide a structured user-agent string that provides a basic description of the calling library, version & platform to facilitate issue diagnosis in heterogeneous environments. The following structure is recommended to library developers
``` ```
@ -177,7 +177,7 @@ grpc-ruby-jruby/1.3.4
grpc-java-android/0.9.1 (gingerbread/1.2.4; nexus5; tmobile) grpc-java-android/0.9.1 (gingerbread/1.2.4; nexus5; tmobile)
``` ```
####Idempotency and Retries #### Idempotency and Retries
Unless explicitly defined to be, gRPC Calls are not assumed to be idempotent. Specifically: Unless explicitly defined to be, gRPC Calls are not assumed to be idempotent. Specifically:
@ -186,15 +186,15 @@ Unless explicitly defined to be, gRPC Calls are not assumed to be idempotent. S
* Calls that are marked as idempotent may be sent multiple times. * Calls that are marked as idempotent may be sent multiple times.
####HTTP2 Transport Mapping #### HTTP2 Transport Mapping
#####Stream Identification ##### Stream Identification
All GRPC calls need to specify an internal ID. We will use HTTP2 stream-ids as call identifiers in this scheme. NOTE: These id’s are contextual to an open HTTP2 session and will not be unique within a given process that is handling more than one HTTP2 session nor can they be used as GUIDs. All GRPC calls need to specify an internal ID. We will use HTTP2 stream-ids as call identifiers in this scheme. NOTE: These id’s are contextual to an open HTTP2 session and will not be unique within a given process that is handling more than one HTTP2 session nor can they be used as GUIDs.
#####Data Frames ##### Data Frames
DATA frame boundaries have no relation to **Length-Prefixed-Message** boundaries and implementations should make no assumptions about their alignment. DATA frame boundaries have no relation to **Length-Prefixed-Message** boundaries and implementations should make no assumptions about their alignment.
#####Errors ##### Errors
When an application or runtime error occurs during an RPC a **Status** and **Status-Message** are delivered in **Trailers**. When an application or runtime error occurs during an RPC a **Status** and **Status-Message** are delivered in **Trailers**.
@ -219,20 +219,20 @@ ENHANCE_YOUR_CALM|RESOURCE_EXHAUSTED ...with additional error detail provided by
INADEQUATE_SECURITY| PERMISSION_DENIED … with additional detail indicating that permission was denied as protocol is not secure enough for call. INADEQUATE_SECURITY| PERMISSION_DENIED … with additional detail indicating that permission was denied as protocol is not secure enough for call.
#####Security ##### Security
The HTTP2 specification mandates the use of TLS 1.2 or higher when TLS is used with HTTP2. It also places some additional constraints on the allowed ciphers in deployments to avoid known-problems as well as requiring SNI support. It is also expected that HTTP2 will be used in conjunction with proprietary transport security mechanisms about which the specification can make no meaningful recommendations. The HTTP2 specification mandates the use of TLS 1.2 or higher when TLS is used with HTTP2. It also places some additional constraints on the allowed ciphers in deployments to avoid known-problems as well as requiring SNI support. It is also expected that HTTP2 will be used in conjunction with proprietary transport security mechanisms about which the specification can make no meaningful recommendations.
#####Connection Management ##### Connection Management
######GOAWAY Frame ###### GOAWAY Frame
Sent by servers to clients to indicate that they will no longer accept any new streams on the associated connections. This frame includes the id of the last successfully accepted stream by the server. Clients should consider any stream initiated after the last successfully accepted stream as UNAVAILABLE and retry the call elsewhere. Clients are free to continue working with the already accepted streams until they complete or the connection is terminated. Sent by servers to clients to indicate that they will no longer accept any new streams on the associated connections. This frame includes the id of the last successfully accepted stream by the server. Clients should consider any stream initiated after the last successfully accepted stream as UNAVAILABLE and retry the call elsewhere. Clients are free to continue working with the already accepted streams until they complete or the connection is terminated.
Servers should send GOAWAY before terminating a connection to reliably inform clients which work has been accepted by the server and is being executed. Servers should send GOAWAY before terminating a connection to reliably inform clients which work has been accepted by the server and is being executed.
######PING Frame ###### PING Frame
Both clients and servers can send a PING frame that the peer must respond to by precisely echoing what they received. This is used to assert that the connection is still live as well as providing a means to estimate end-to-end latency. If a server initiated PING does not receive a response within the deadline expected by the runtime all outstanding calls on the server will be closed with a CANCELLED status. An expired client initiated PING will cause all calls to be closed with an UNAVAILABLE status. Note that the frequency of PINGs is highly dependent on the network environment, implementations are free to adjust PING frequency based on network and application requirements. Both clients and servers can send a PING frame that the peer must respond to by precisely echoing what they received. This is used to assert that the connection is still live as well as providing a means to estimate end-to-end latency. If a server initiated PING does not receive a response within the deadline expected by the runtime all outstanding calls on the server will be closed with a CANCELLED status. An expired client initiated PING will cause all calls to be closed with an UNAVAILABLE status. Note that the frequency of PINGs is highly dependent on the network environment, implementations are free to adjust PING frequency based on network and application requirements.
######Connection failure ###### Connection failure
If a detectable connection failure occurs on the client all calls will be closed with an UNAVAILABLE status. For servers open calls will be closed with a CANCELLED status. If a detectable connection failure occurs on the client all calls will be closed with an UNAVAILABLE status. For servers open calls will be closed with a CANCELLED status.

@ -83,7 +83,8 @@ in the body.
User Agent User Agent
* U-A: grpc-web-javascript * Do NOT use User-Agent header (which is to be set by browsers, by default)
* Use X-User-Agent: grpc-web-javascript/0.1 (follow the same format as specified in [gRPC over HTTP2](http://www.grpc.io/docs/guides/wire.html))
--- ---
@ -94,8 +95,6 @@ the response stream needs to be text encoded e.g. when XHR is used or due
to security policies with XHR to security policies with XHR
* Accept: application/grpc-web-text * Accept: application/grpc-web-text
2. The default text encoding is base64 2. The default text encoding is base64
* Text encoding may be specified with Content-Type or Accept headers as
* application/grpc-web-text-base64
* Note that “Content-Transfer-Encoding: base64” should not be used. * Note that “Content-Transfer-Encoding: base64” should not be used.
Due to in-stream base64 padding when delimiting messages, the entire Due to in-stream base64 padding when delimiting messages, the entire
response body is not necessarily a valid base64-encoded entity response body is not necessarily a valid base64-encoded entity

@ -2,7 +2,7 @@
## Format ## Format
The log format is described in [this proto file](src/proto/grpc/binary_log/v1alpha/log.proto). It is intended that multiple parts of the call will be logged in separate files, and then correlated by analysis tools using the rpc\_id. The log format is described in [this proto file](/src/proto/grpc/binary_log/v1alpha/log.proto). It is intended that multiple parts of the call will be logged in separate files, and then correlated by analysis tools using the rpc\_id.
## API ## API

@ -0,0 +1,158 @@
# Combiner Explanation
## Talk by ctiller, notes by vjpai
Typical way of doing critical section
```
mu.lock()
do_stuff()
mu.unlock()
```
An alternative way of doing it is
```
class combiner {
run(f) {
mu.lock()
f()
mu.unlock()
}
mutex mu;
}
combiner.run(do_stuff)
```
If you have two threads calling combiner, there will be some kind of
queuing in place. It's called `combiner` because you can pass in more
than one do_stuff at once and they will run under a common `mu`.
The implementation described above has the issue that you're blocking a thread
for a period of time, and this is considered harmful because it's an application thread that you're blocking.
Instead, get a new property:
* Keep things running in serial execution
* Don't ever sleep the thread
* But maybe allow things to end up running on a different thread from where they were started
* This means that `do_stuff` doesn't necessarily run to completion when `combiner.run` is invoked
```
class combiner {
mpscq q; // multi-producer single-consumer queue can be made non-blocking
state s; // is it empty or executing
run(f) {
if (q.push(f)) {
// q.push returns true if it's the first thing
while (q.pop(&f)) { // modulo some extra work to avoid races
f();
}
}
}
}
```
The basic idea is that the first one to push onto the combiner
executes the work and then keeps executing functions from the queue
until the combiner is drained.
Our combiner does some additional work, with the motivation of write-batching.
We have a second tier of `run` called `run_finally`. Anything queued
onto `run_finally` runs after we have drained the queue. That means
that there is essentially a finally-queue. This is not guaranteed to
be final, but it's best-effort. In the process of running the finally
item, we might put something onto the main combiner queue and so we'll
need to re-enter.
`chttp2` runs all ops in the run state except if it sees a write it puts that into a finally. That way anything else that gets put into the combiner can add to that write.
```
class combiner {
mpscq q; // multi-producer single-consumer queue can be made non-blocking
state s; // is it empty or executing
queue finally; // you can only do run_finally when you are already running something from the combiner
run(f) {
if (q.push(f)) {
// q.push returns true if it's the first thing
loop:
while (q.pop(&f)) { // modulo some extra work to avoid races
f();
}
while (finally.pop(&f)) {
f();
}
goto loop;
}
}
}
```
So that explains how combiners work in general. In gRPC, there is
`start_batch(..., tag)` and then work only gets activated by somebody
calling `cq::next` which returns a tag. This gives an API-level
guarantee that there will be a thread doing polling to actually make
work happen. However, some operations are not covered by a poller
thread, such as cancellation that doesn't have a completion. Other
callbacks that don't have a completion are the internal work that gets
done before the batch gets completed. We need a condition called
`covered_by_poller` that means that the item will definitely need some
thread at some point to call `cq::next` . This includes those
callbacks that directly cause a completion but also those that are
indirectly required before getting a completion. If we can't tell for
sure for a specific path, we have to assumed it is not covered by
poller.
The above combiner has the problem that it keeps draining for a
potentially infinite amount of time and that can lead to a huge tail
latency for some operations. So we can tweak it by returning to the application
if we know that it is valid to do so:
```
while (q.pop(&f)) {
f();
if (control_can_be_returned && some_still_queued_thing_is_covered_by_poller) {
offload_combiner_work_to_some_other_thread();
}
}
```
`offload` is more than `break`; it does `break` but also causes some
other thread that is currently waiting on a poll to break out of its
poll. This is done by setting up a per-polling-island work-queue
(distributor) wakeup FD. The work-queue is the converse of the combiner; it
tries to spray events onto as many threads as possible to get as much concurrency as possible.
So `offload` really does:
```
workqueue.run(continue_from_while_loop);
break;
```
This needs us to add another class variable for a `workqueue`
(which is really conceptually a distributor).
```
workqueue::run(f) {
q.push(f)
eventfd.wakeup()
}
workqueue::readable() {
eventfd.consume();
q.pop(&f);
f();
if (!q.empty()) {
eventfd.wakeup(); // spray across as many threads as are waiting on this workqueue
}
}
```
In principle, `run_finally` could get starved, but this hasn't
happened in practice. If we were concerned about this, we could put a
limit on how many things come off the regular `q` before the `finally`
queue gets processed.

@ -0,0 +1,160 @@
# gRPC Error
## Background
`grpc_error` is the c-core's opaque representation of an error. It holds a
collection of integers, strings, timestamps, and child errors that related to
the final error.
always present are:
* GRPC_ERROR_STR_FILE and GRPC_ERROR_INT_FILE_LINE - the source location where
the error was generated
* GRPC_ERROR_STR_DESCRIPTION - a human readable description of the error
* GRPC_ERROR_TIME_CREATED - a timestamp indicating when the error happened
An error can also have children; these are other errors that are believed to
have contributed to this one. By accumulating children, we can begin to root
cause high level failures from low level failures, without having to derive
execution paths from log lines.
grpc_errors are refcounted objects, which means they need strict ownership
semantics. An extra ref on an error can cause a memory leak, and a missing ref
can cause a crash.
This document serves as a detailed overview of grpc_error's ownership rules. It
should help people use the errors, as well as help people debug refcount related
errors.
## Clarification of Ownership
If a particular function is said to "own" an error, that means it has the
responsibility of calling unref on the error. A function may have access to an
error without ownership of it.
This means the function may use the error, but must not call unref on it, since
that will be done elsewhere in the code. A function that does not own an error
may explicitly take ownership of it by manually calling GRPC_ERROR_REF.
## Ownership Rules
There are three rules of error ownership, which we will go over in detail.
* If `grpc_error` is returned by a function, the caller owns a ref to that
instance.
* If a `grpc_error` is passed to a `grpc_closure` callback function, then that
function does not own a ref to the error.
* if a `grpc_error` is passed to *any other function*, then that function
takes ownership of the error.
### Rule 1
> If `grpc_error` is returned by a function, the caller owns a ref to that
> instance.*
For example, in the following code block, error1 and error2 are owned by the
current function.
```C
grpc_error* error1 = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Some error occured");
grpc_error* error2 = some_operation_that_might_fail(...);
```
The current function would have to explicitly call GRPC_ERROR_UNREF on the
errors, or pass them along to a function that would take over the ownership.
### Rule 2
> If a `grpc_error` is passed to a `grpc_closure` callback function, then that
> function does not own a ref to the error.
A `grpc_closure` callback function is any function that has the signature:
```C
void (*cb)(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error);
```
This means that the error ownership is NOT transferred when a functions calls:
```C
c->cb(exec_ctx, c->cb_arg, err);
```
The caller is still responsible for unref-ing the error.
However, the above line is currently being phased out! It is safer to invoke
callbacks with `grpc_closure_run` and `grpc_closure_sched`. These functions are
not callbacks, so they will take ownership of the error passed to them.
```C
grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Some error occured");
grpc_closure_run(exec_ctx, cb, error);
// current function no longer has ownership of the error
```
If you schedule or run a closure, but still need ownership of the error, then
you must explicitly take a reference.
```C
grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Some error occured");
grpc_closure_run(exec_ctx, cb, GRPC_ERROR_REF(error));
// do some other things with the error
GRPC_ERROR_UNREF(error);
```
Rule 2 is more important to keep in mind when **implementing** `grpc_closure`
callback functions. You must keep in mind that you do not own the error, and
must not unref it. More importantly, you cannot pass it to any function that
would take ownership of the error, without explicitly taking ownership yourself.
For example:
```C
void on_some_action(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
// this would cause a crash, because some_function will unref the error,
// and the caller of this callback will also unref it.
some_function(error);
// this callback function must take ownership, so it can give that
// ownership to the function it is calling.
some_function(GRPC_ERROR_REF(error));
}
```
### Rule 3
> if a `grpc_error` is passed to *any other function*, then that function takes
> ownership of the error.
Take the following example:
```C
grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Some error occured");
// do some things
some_function(error);
// can't use error anymore! might be gone.
```
When some_function is called, it takes over the ownership of the error, and it
will eventually unref it. So the caller can no longer safely use the error.
If the caller needed to keep using the error (or passing it to other functions),
if would have to take on a reference to it. This is a common pattern seen.
```C
void func() {
grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Some error");
some_function(GRPC_ERROR_REF(error));
// do things
some_other_function(GRPC_ERROR_REF(error));
// do more things
some_last_function(error);
}
```
The last call takes ownership and will eventually give the error its final
unref.
When **implementing** a function that takes an error (and is not a
`grpc_closure` callback function), you must ensure the error is unref-ed either
by doing it explicitly with GRPC_ERROR_UNREF, or by passing the error to a
function that takes over the ownership.

@ -55,6 +55,7 @@ some configuration as environment variables that can be set.
- queue_timeout - queue_timeout
- server_channel - lightweight trace of significant server channel events - server_channel - lightweight trace of significant server channel events
- secure_endpoint - traces bytes flowing through encrypted channels - secure_endpoint - traces bytes flowing through encrypted channels
- timer - timers (alarms) in the grpc internals
- transport_security - traces metadata about secure channel establishment - transport_security - traces metadata about secure channel establishment
- tcp - traces bytes in and out of a channel - tcp - traces bytes in and out of a channel
@ -69,3 +70,11 @@ some configuration as environment variables that can be set.
- DEBUG - log all gRPC messages - DEBUG - log all gRPC messages
- INFO - log INFO and ERROR message - INFO - log INFO and ERROR message
- ERROR - log only errors - ERROR - log only errors
* GRPC_DNS_RESOLVER
Declares which DNS resolver to use. The default is ares if gRPC is built with
c-ares support. Otherwise, the value of this environment variable is ignored.
Available DNS resolver include:
- native (default)- a DNS resolver based around getaddrinfo(), creates a new thread to
perform name resolution
- ares - a DNS resolver based around the c-ares library

@ -7,3 +7,5 @@ future), and the corresponding version numbers that used them:
- 1.0 'g' stands for 'gRPC' - 1.0 'g' stands for 'gRPC'
- 1.1 'g' stands for 'good' - 1.1 'g' stands for 'good'
- 1.2 'g' stands for 'green' - 1.2 'g' stands for 'green'
- 1.3 'g' stands for 'gentle'
- 1.4 'g' stands for 'gregarious'

@ -193,3 +193,79 @@ Server Procedure:
1. Sets MAX_CONCURRENT_STREAMS to one after the connection is made. 1. Sets MAX_CONCURRENT_STREAMS to one after the connection is made.
*The assertion that the MAX_CONCURRENT_STREAMS limit is upheld occurs in the http2 library we used.* *The assertion that the MAX_CONCURRENT_STREAMS limit is upheld occurs in the http2 library we used.*
### data_frame_padding
This test verifies that the client can correctly receive padded http2 data
frames. It also stresses the client's flow control (there is a high chance
that the sender will deadlock if the client's flow control logic doesn't
correctly account for padding).
Client Procedure:
(Note this is the same procedure as in the "large_unary" gRPC interop tests.
Clients should use their "large_unary" gRPC interop test implementations.)
Procedure:
1. Client calls UnaryCall with:
```
{
response_size: 314159
payload:{
body: 271828 bytes of zeros
}
}
```
Client asserts:
* call was successful
* response payload body is 314159 bytes in size
* clients are free to assert that the response payload body contents are zero
and comparing the entire response message against a golden response
Server Procedure:
1. Reply to the client's request with a `SimpleResponse`, with a payload
body length of `SimpleRequest.response_size`. But send it across specific
http2 data frames as follows:
* Each http2 data frame contains a 5 byte payload and 255 bytes of padding.
* Note the 5 byte payload and 255 byte padding are partly arbitrary,
and other numbers are also ok. With 255 bytes of padding for each 5 bytes of
payload containing actual gRPC message, the 300KB response size will
multiply into around 15 megabytes of flow control debt, which should stress
flow control accounting.
### no_df_padding_sanity_test
This test verifies that the client can correctly receive a series of small
data frames. Note that this test is intentionally a slight variation of
"data_frame_padding", with the only difference being that this test doesn't use data
frame padding when the response is sent. This test is primarily meant to
prove correctness of the http2 server implementation and highlight failures
of the "data_frame_padding" test.
Client Procedure:
(Note this is the same procedure as in the "large_unary" gRPC interop tests.
Clients should use their "large_unary" gRPC interop test implementations.)
Procedure:
1. Client calls UnaryCall with:
```
{
response_size: 314159
payload:{
body: 271828 bytes of zeros
}
}
```
Client asserts:
* call was successful
* response payload body is 314159 bytes in size
* clients are free to assert that the response payload body contents are zero
and comparing the entire response message against a golden response
Server Procedure:
1. Reply to the client's request with a `SimpleResponse`, with a payload
body length of `SimpleRequest.response_size`. But send it across series of
http2 data frames that contain 5 bytes of "payload" and zero bytes of
"padding" (the padding flags on the data frames should not be set).

@ -27,7 +27,7 @@ Clients should accept these arguments:
* Whether to use a plaintext or encrypted connection * Whether to use a plaintext or encrypted connection
* --use_test_ca=BOOLEAN * --use_test_ca=BOOLEAN
* Whether to replace platform root CAs with * Whether to replace platform root CAs with
[ca.pem](https://github.com/grpc/grpc/blob/master/src/core/lib/tsi/test_creds/ca.pem) [ca.pem](https://github.com/grpc/grpc/blob/master/src/core/tsi/test_creds/ca.pem)
as the CA root as the CA root
* --default_service_account=ACCOUNT_EMAIL * --default_service_account=ACCOUNT_EMAIL
* Email of the GCE default service account. * Email of the GCE default service account.
@ -81,9 +81,8 @@ Procedure:
Client marks the request as cacheable by setting the cacheable flag in the Client marks the request as cacheable by setting the cacheable flag in the
request context. Longer term this should be driven by the method option request context. Longer term this should be driven by the method option
specified in the proto file itself. specified in the proto file itself.
2. Client calls CacheableUnaryCall with `SimpleRequest` request again 2. Client calls CacheableUnaryCall again immediately with the same request and
immediately with the same payload as the previous request. Cacheable flag is configuration as the previous call.
also set for this request's context.
Client asserts: Client asserts:
* Both calls were successful * Both calls were successful
@ -969,7 +968,7 @@ Servers should accept these arguments:
* Whether to use a plaintext or encrypted connection * Whether to use a plaintext or encrypted connection
Servers must support TLS with ALPN. They should use Servers must support TLS with ALPN. They should use
[server1.pem](https://github.com/grpc/grpc/blob/master/src/core/lib/tsi/test_creds/server1.pem) [server1.pem](https://github.com/grpc/grpc/blob/master/src/core/tsi/test_creds/server1.pem)
for their certificate. for their certificate.
### EmptyCall ### EmptyCall
@ -986,6 +985,7 @@ for the `SimpleRequest.response_type`. If the server does not support the
`response_type`, then it should fail the RPC with `INVALID_ARGUMENT`. `response_type`, then it should fail the RPC with `INVALID_ARGUMENT`.
### CacheableUnaryCall ### CacheableUnaryCall
[CacheableUnaryCall]: #cacheableunarycall
Server gets the default SimpleRequest proto as the request. The content of the Server gets the default SimpleRequest proto as the request. The content of the
request is ignored. It returns the SimpleResponse proto with the payload set request is ignored. It returns the SimpleResponse proto with the payload set

@ -13,7 +13,7 @@ The contents of the *auth properties* are populated by an *auth interceptor*. Th
WARNING: AuthContext is the only reliable source of truth when it comes to authenticating RPCs. Using any other call/context properties for authentication purposes is wrong and inherently unsafe. WARNING: AuthContext is the only reliable source of truth when it comes to authenticating RPCs. Using any other call/context properties for authentication purposes is wrong and inherently unsafe.
####Example AuthContext contents #### Example AuthContext contents
For secure channel using mutual TLS authentication with both client and server certificates (test certificates from this repository are used). For secure channel using mutual TLS authentication with both client and server certificates (test certificates from this repository are used).
@ -45,7 +45,7 @@ gRPC comes with some basic "interceptors" already built-in.
WARNING: While there is a public API that allows anyone to write their own custom interceptor, please think twice before using it. WARNING: While there is a public API that allows anyone to write their own custom interceptor, please think twice before using it.
There are legitimate uses for custom interceptors but you should keep in mind that as auth interceptors essentially decide which RPCs are authenticated and which are not, their code is very sensitive from the security perspective and getting things wrong might have serious consequences. If unsure, we strongly recommend to rely on official & proven interceptors that come with gRPC. There are legitimate uses for custom interceptors but you should keep in mind that as auth interceptors essentially decide which RPCs are authenticated and which are not, their code is very sensitive from the security perspective and getting things wrong might have serious consequences. If unsure, we strongly recommend to rely on official & proven interceptors that come with gRPC.
####Available auth interceptors #### Available auth interceptors
- TLS/SSL certificate authentication (built into gRPC's security layer, automatically used whenever you use a secure connection) - TLS/SSL certificate authentication (built into gRPC's security layer, automatically used whenever you use a secure connection)
- (coming soon) JWT auth token authentication - (coming soon) JWT auth token authentication
- more will be added over time - more will be added over time

@ -13,12 +13,21 @@ The service config is a JSON string of the following form:
``` ```
{ {
// Load balancing policy name. // Load balancing policy name.
// Supported values are 'round_robin' and 'grpclb'. // Currently, the only selectable client-side policy provided with gRPC
// Optional; if unset, the default behavior is pick the first available // is 'round_robin', but third parties may add their own policies.
// backend. // This field is optional; if unset, the default behavior is to pick
// Note that if the resolver returns only balancer addresses and no // the first available backend.
// backend addresses, gRPC will always use the 'grpclb' policy, // If the policy name is set via the client API, that value overrides
// regardless of what this field is set to. // the value specified here.
//
// Note that if the resolver returns at least one balancer address (as
// opposed to backend addresses), gRPC will use grpclb (see
// https://github.com/grpc/grpc/blob/master/doc/load-balancing.md),
// regardless of what LB policy is requested either here or via the
// client API. However, if the resolver returns at least one backend
// address in addition to the balancer address(es), the client may fall
// back to the requested policy if it is unable to reach any of the
// grpclb load balancers.
'loadBalancingPolicy': string, 'loadBalancingPolicy': string,
// Per-method configuration. Optional. // Per-method configuration. Optional.

@ -0,0 +1,16 @@
Ordering Status and Reads in the gRPC API
-----------------------------------------
Rules for implementors:
1. Reads and Writes Must not succeed after Status has been delivered.
2. OK Status is only delivered after all buffered messages are read.
3. Reads May continue to succeed after a failing write.
However, once a write fails, all subsequent writes Must fail,
and similarly, once a read fails, all subsequent reads Must fail.
4. When an error status is known to the library, if the user asks for status,
the library Should discard messages received in the library but not delivered
to the user and then deliver the status. If the user does not ask for status
but continues reading, the library Should deliver buffered messages before
delivering status. The library MAY choose to implement the stricter version
where errors cause all buffered messages to be dropped, but this is not a
requirement.

@ -1,9 +1,20 @@
# Status codes and their use in gRPC # Status codes and their use in gRPC
gRPC uses a set of well defined status codes as part of the RPC API. All RPCs started at a client return a `status` object composed of an integer `code` and a string `message`. The server-side can choose the status it returns for a given RPC. gRPC uses a set of well defined status codes as part of the RPC API. All
RPCs started at a client return a `status` object composed of an integer
`code` and a string `message`. The server-side can choose the status it
returns for a given RPC.
The gRPC client and server-side implementations may also generate and return `status` on their own when errors happen. The gRPC client and server-side implementations may also generate and
Only a subset of the pre-defined status codes are generated by the gRPC libraries. The following table lists these codes and summarizes the situations in which they are generated, either by the client or the server-side library implementation. return `status` on their own when errors happen. Only a subset of
the pre-defined status codes are generated by the gRPC libraries. This
allows applications to be sure that any other code it sees was actually
returned by the application (although it is also possible for the
server-side to return one of the codes generated by the gRPC libraries).
The following table lists the codes that may be returned by the gRPC
libraries (on either the client-side or server-side) and summarizes the
situations in which they are generated.
| Case | Code | Generated at Client or Server | | Case | Code | Generated at Client or Server |
| ------------- |:-------------| :-----:| | ------------- |:-------------| :-----:|
@ -26,7 +37,7 @@ Only a subset of the pre-defined status codes are generated by the gRPC librarie
| Response cardinality violation (method requires exactly one response but server sent some other number of responses) | UNIMPLEMENTED | Client| | Response cardinality violation (method requires exactly one response but server sent some other number of responses) | UNIMPLEMENTED | Client|
| Error parsing response proto | INTERNAL | Client| | Error parsing response proto | INTERNAL | Client|
| Error parsing request proto | INTERNAL | Server| | Error parsing request proto | INTERNAL | Server|
| Sent or received message was larger than configured limit | RESOURCE_EXHAUSTED | Both |
The following status codes are never generated by the library: The following status codes are never generated by the library:
- INVALID_ARGUMENT - INVALID_ARGUMENT

@ -1617,42 +1617,6 @@ wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN
pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
-----END CERTIFICATE----- -----END CERTIFICATE-----
# Issuer: CN=WellsSecure Public Root Certificate Authority O=Wells Fargo WellsSecure OU=Wells Fargo Bank NA
# Subject: CN=WellsSecure Public Root Certificate Authority O=Wells Fargo WellsSecure OU=Wells Fargo Bank NA
# Label: "WellsSecure Public Root Certificate Authority"
# Serial: 1
# MD5 Fingerprint: 15:ac:a5:c2:92:2d:79:bc:e8:7f:cb:67:ed:02:cf:36
# SHA1 Fingerprint: e7:b4:f6:9d:61:ec:90:69:db:7e:90:a7:40:1a:3c:f4:7d:4f:e8:ee
# SHA256 Fingerprint: a7:12:72:ae:aa:a3:cf:e8:72:7f:7f:b3:9f:0f:b3:d1:e5:42:6e:90:60:b0:6e:e6:f1:3e:9a:3c:58:33:cd:43
-----BEGIN CERTIFICATE-----
MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMx
IDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxs
cyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9v
dCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDcxMjEzMTcwNzU0WhcNMjIxMjE0
MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdl
bGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQD
DC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+r
WxxTkqxtnt3CxC5FlAM1iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjU
Dk/41itMpBb570OYj7OeUt9tkTmPOL13i0Nj67eT/DBMHAGTthP796EfvyXhdDcs
HqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8bJVhHlfXBIEyg1J55oNj
z7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiBK0HmOFaf
SZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/Slwxl
AgMBAAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqG
KGh0dHA6Ly9jcmwucGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0P
AQH/BAQDAgHGMB0GA1UdDgQWBBQmlRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0j
BIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGBi6SBiDCBhTELMAkGA1UEBhMC
VVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNX
ZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg
Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEB
ALkVsUSRzCPIK0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd
/ZDJPHV3V3p9+N701NX3leZ0bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pB
A4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSljqHyita04pO2t/caaH/+Xc/77szWn
k4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+esE2fDbbFwRnzVlhE9
iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJtylv
2G0xffX8oRAHh84vWdw+WNs=
-----END CERTIFICATE-----
# Issuer: CN=COMODO ECC Certification Authority O=COMODO CA Limited # Issuer: CN=COMODO ECC Certification Authority O=COMODO CA Limited
# Subject: CN=COMODO ECC Certification Authority O=COMODO CA Limited # Subject: CN=COMODO ECC Certification Authority O=COMODO CA Limited
# Label: "COMODO ECC Certification Authority" # Label: "COMODO ECC Certification Authority"
@ -1738,57 +1702,6 @@ Fj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ
/L7fCg0= /L7fCg0=
-----END CERTIFICATE----- -----END CERTIFICATE-----
# Issuer: CN=Microsec e-Szigno Root CA O=Microsec Ltd. OU=e-Szigno CA
# Subject: CN=Microsec e-Szigno Root CA O=Microsec Ltd. OU=e-Szigno CA
# Label: "Microsec e-Szigno Root CA"
# Serial: 272122594155480254301341951808045322001
# MD5 Fingerprint: f0:96:b6:2f:c5:10:d5:67:8e:83:25:32:e8:5e:2e:e5
# SHA1 Fingerprint: 23:88:c9:d3:71:cc:9e:96:3d:ff:7d:3c:a7:ce:fc:d6:25:ec:19:0d
# SHA256 Fingerprint: 32:7a:3d:76:1a:ba:de:a0:34:eb:99:84:06:27:5c:b1:a4:77:6e:fd:ae:2f:df:6d:01:68:ea:1c:4f:55:67:d0
-----BEGIN CERTIFICATE-----
MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAw
cjELMAkGA1UEBhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNy
b3NlYyBMdGQuMRQwEgYDVQQLEwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9z
ZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0MDYxMjI4NDRaFw0xNzA0MDYxMjI4
NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEWMBQGA1UEChMN
TWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMTGU1p
Y3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
ggEKAoIBAQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2u
uO/TEdyB5s87lozWbxXGd36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+
LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/NoqdNAoI/gqyFxuEPkEeZlApxcpMqyabA
vjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjcQR/Ji3HWVBTji1R4P770
Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJPqW+jqpx
62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcB
AQRbMFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3Aw
LQYIKwYBBQUHMAKGIWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAP
BgNVHRMBAf8EBTADAQH/MIIBcwYDVR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIB
AQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3LmUtc3ppZ25vLmh1L1NaU1ov
MIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0AdAB2AOEAbgB5
ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn
AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABT
AHoAbwBsAGcA4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABh
ACAAcwB6AGUAcgBpAG4AdAAgAGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABo
AHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMAegBpAGcAbgBvAC4AaAB1AC8AUwBa
AFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6Ly93d3cuZS1zemln
bm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NOPU1p
Y3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxP
PU1pY3Jvc2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZv
Y2F0aW9uTGlzdDtiaW5hcnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuB
EGluZm9AZS1zemlnbm8uaHWkdzB1MSMwIQYDVQQDDBpNaWNyb3NlYyBlLVN6aWdu
w7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhTWjEWMBQGA1UEChMNTWlj
cm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhVMIGsBgNV
HSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJI
VTERMA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDAS
BgNVBAsTC2UtU3ppZ25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBS
b290IENBghEAzLjnv04pGv2i3GalHCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS
8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMTnGZjWS7KXHAM/IO8VbH0jgds
ZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FEaGAHQzAxQmHl
7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a
86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfR
hUZLphK3dehKyVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/
MPMMNz7UwiiAc7EBt51alhQBS6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU=
-----END CERTIFICATE-----
# Issuer: CN=Certigna O=Dhimyotis # Issuer: CN=Certigna O=Dhimyotis
# Subject: CN=Certigna O=Dhimyotis # Subject: CN=Certigna O=Dhimyotis
# Label: "Certigna" # Label: "Certigna"
@ -2014,36 +1927,6 @@ buXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2G8kS1sHNzYDzAgE8yGnLRUhj
2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5mmxE= 2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5mmxE=
-----END CERTIFICATE----- -----END CERTIFICATE-----
# Issuer: O=Japanese Government OU=ApplicationCA
# Subject: O=Japanese Government OU=ApplicationCA
# Label: "ApplicationCA - Japanese Government"
# Serial: 49
# MD5 Fingerprint: 7e:23:4e:5b:a7:a5:b4:25:e9:00:07:74:11:62:ae:d6
# SHA1 Fingerprint: 7f:8a:b0:cf:d0:51:87:6a:66:f3:36:0f:47:c8:8d:8c:d3:35:fc:74
# SHA256 Fingerprint: 2d:47:43:7d:e1:79:51:21:5a:12:f3:c5:8e:51:c7:29:a5:80:26:ef:1f:cc:0a:5f:b3:d9:dc:01:2f:60:0d:19
-----BEGIN CERTIFICATE-----
MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEc
MBoGA1UEChMTSmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRp
b25DQTAeFw0wNzEyMTIxNTAwMDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYT
AkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zlcm5tZW50MRYwFAYDVQQLEw1BcHBs
aWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp23gdE6H
j6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4fl+K
f5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55
IrmTwcrNwVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cw
FO5cjFW6WY2H/CPek9AEjP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDiht
QWEjdnjDuGWk81quzMKq2edY3rZ+nYVunyoKb58DKTCXKB28t89UKU5RMfkntigm
/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRUWssmP3HMlEYNllPqa0jQ
k/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNVBAYTAkpQ
MRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOC
seODvOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
ggEBADlqRHZ3ODrso2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJ
hyzjVOGjprIIC8CFqMjSnHH2HZ9g/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+
eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYDio+nEhEMy/0/ecGc/WLuo89U
DNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmWdupwX3kSa+Sj
B1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL
rosot4LKGAfmt1t06SAZf7IbiVQ=
-----END CERTIFICATE-----
# Issuer: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only # Issuer: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only
# Subject: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only # Subject: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only
# Label: "GeoTrust Primary Certification Authority - G3" # Label: "GeoTrust Primary Certification Authority - G3"
@ -4720,39 +4603,6 @@ Yv4HAqGEVka+lgqaE9chTLd8B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW
+qtB4Uu2NQvAmxU= +qtB4Uu2NQvAmxU=
-----END CERTIFICATE----- -----END CERTIFICATE-----
# Issuer: CN=TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6 O=TÜRKTRUST Bilgi İletişim ve Bilişim Güvenliği Hizmetleri A.Ş.
# Subject: CN=TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6 O=TÜRKTRUST Bilgi İletişim ve Bilişim Güvenliği Hizmetleri A.Ş.
# Label: "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6"
# Serial: 138134509972618
# MD5 Fingerprint: f8:c5:ee:2a:6b:be:95:8d:08:f7:25:4a:ea:71:3e:46
# SHA1 Fingerprint: 8a:5c:8c:ee:a5:03:e6:05:56:ba:d8:1b:d4:f6:c9:b0:ed:e5:2f:e0
# SHA256 Fingerprint: 8d:e7:86:55:e1:be:7f:78:47:80:0b:93:f6:94:d2:1d:36:8c:c0:6e:03:3e:7f:ab:04:bb:5e:b9:9d:a6:b7:00
-----BEGIN CERTIFICATE-----
MIIEJjCCAw6gAwIBAgIGfaHyZeyKMA0GCSqGSIb3DQEBCwUAMIGxMQswCQYDVQQG
EwJUUjEPMA0GA1UEBwwGQW5rYXJhMU0wSwYDVQQKDERUw5xSS1RSVVNUIEJpbGdp
IMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBB
LsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBI
aXptZXQgU2HEn2xhecSxY8Sxc8SxIEg2MB4XDTEzMTIxODA5MDQxMFoXDTIzMTIx
NjA5MDQxMFowgbExCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExTTBLBgNV
BAoMRFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2
ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMUIwQAYDVQQDDDlUw5xSS1RSVVNUIEVs
ZWt0cm9uaWsgU2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLEgSDYwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCdsGjW6L0UlqMACprx9MfMkU1x
eHe59yEmFXNRFpQJRwXiM/VomjX/3EsvMsew7eKC5W/a2uqsxgbPJQ1BgfbBOCK9
+bGlprMBvD9QFyv26WZV1DOzXPhDIHiTVRZwGTLmiddk671IUP320EEDwnS3/faA
z1vFq6TWlRKb55cTMgPp1KtDWxbtMyJkKbbSk60vbNg9tvYdDjTu0n2pVQ8g9P0p
u5FbHH3GQjhtQiht1AH7zYiXSX6484P4tZgvsycLSF5W506jM7NE1qXyGJTtHB6p
lVxiSvgNZ1GpryHV+DKdeboaX+UEVU0TRv/yz3THGmNtwx8XEsMeED5gCLMxAgMB
AAGjQjBAMB0GA1UdDgQWBBTdVRcT9qzoSCHK77Wv0QAy7Z6MtTAOBgNVHQ8BAf8E
BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAb1gNl0Oq
FlQ+v6nfkkU/hQu7VtMMUszIv3ZnXuaqs6fvuay0EBQNdH49ba3RfdCaqaXKGDsC
QC4qnFAUi/5XfldcEQlLNkVS9z2sFP1E34uXI9TDwe7UU5X+LEr+DXCqu4svLcsy
o4LyVN/Y8t3XSHLuSqMplsNEzm61kod2pLv0kmzOLBQJZo6NrRa1xxsJYTvjIKID
gI6tflEATseWhvtDmHd9KMeP2Cpu54Rvl0EpABZeTeIT6lnAY2c6RPuY/ATTMHKm
9ocJV612ph1jmv3XZch4gyt1O6VbuA1df74jrlZVlFjvH4GMKrLN5ptjnhi85WsG
tAuYSyher4hYyw==
-----END CERTIFICATE-----
# Issuer: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903 # Issuer: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903
# Subject: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903 # Subject: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903
# Label: "Certinomis - Root CA" # Label: "Certinomis - Root CA"
@ -5402,3 +5252,37 @@ LSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+
x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31IiyBMz2TWuJdGsE7RKlY6 x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31IiyBMz2TWuJdGsE7RKlY6
oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr
-----END CERTIFICATE----- -----END CERTIFICATE-----
# Issuer: CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM
# Subject: CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM
# Label: "TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1"
# Serial: 1
# MD5 Fingerprint: dc:00:81:dc:69:2f:3e:2f:b0:3b:f6:3d:5a:91:8e:49
# SHA1 Fingerprint: 31:43:64:9b:ec:ce:27:ec:ed:3a:3f:0b:8f:0d:e4:e8:91:dd:ee:ca
# SHA256 Fingerprint: 46:ed:c3:68:90:46:d5:3a:45:3f:b3:10:4a:b8:0d:ca:ec:65:8b:26:60:ea:16:29:dd:7e:86:79:90:64:87:16
-----BEGIN CERTIFICATE-----
MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIx
GDAWBgNVBAcTD0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxp
bXNlbCB2ZSBUZWtub2xvamlrIEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0w
KwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24gTWVya2V6aSAtIEthbXUgU00xNjA0
BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRpZmlrYXNpIC0gU3Vy
dW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYDVQQG
EwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXll
IEJpbGltc2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklU
QUsxLTArBgNVBAsTJEthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBT
TTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11IFNNIFNTTCBLb2sgU2VydGlmaWthc2kg
LSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr3UwM6q7
a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y86Ij5iySr
LqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INr
N3wcwv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2X
YacQuFWQfw4tJzh03+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/
iSIzL+aFCr2lqBs23tPcLG07xxO9WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4f
AJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQUZT/HiobGPN08VFw1+DrtUgxH
V8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL
BQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh
AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPf
IPP54+M638yclNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4
lzwDGrpDxpa5RXI4s6ehlj2Re37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c
8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0jq5Rm+K37DwhuJi1/FwcJsoz7UMCf
lo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM=
-----END CERTIFICATE-----

@ -27,16 +27,40 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package(default_visibility = ["//visibility:public"])
load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
grpc_proto_library(
name = "auth_sample",
srcs = ["protos/auth_sample.proto"],
)
grpc_proto_library(
name = "hellostreamingworld",
srcs = ["protos/hellostreamingworld.proto"],
)
grpc_proto_library(
name = "helloworld",
srcs = ["protos/helloworld.proto"],
)
grpc_proto_library(
name = "route_guide",
srcs = ["protos/route_guide.proto"],
)
cc_binary( cc_binary(
name = "greeter_client", name = "greeter_client",
srcs = ["greeter_client.cc"], srcs = ["cpp/helloworld/greeter_client.cc"],
deps = ["//examples/protos:helloworld"], deps = ["helloworld"],
defines = ["BAZEL_BUILD"], defines = ["BAZEL_BUILD"],
) )
cc_binary( cc_binary(
name = "greeter_server", name = "greeter_server",
srcs = ["greeter_server.cc"], srcs = ["cpp/helloworld/greeter_server.cc"],
deps = ["//examples/protos:helloworld"], deps = ["helloworld"],
defines = ["BAZEL_BUILD"], defines = ["BAZEL_BUILD"],
) )

@ -1,4 +1,4 @@
#gRPC in 3 minutes (C++) # gRPC in 3 minutes (C++)
## Installation ## Installation

@ -1,4 +1,4 @@
#gRPC Basics: C++ # gRPC Basics: C++
This tutorial provides a basic C++ programmer's introduction to working with This tutorial provides a basic C++ programmer's introduction to working with
gRPC. By walking through this example you'll learn how to: gRPC. By walking through this example you'll learn how to:

@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Greeter", "Greeter\Greeter.csproj", "{13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GreeterClient", "GreeterClient\GreeterClient.csproj", "{B754FB02-D501-4308-8B89-33AB7119C80D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GreeterServer", "GreeterServer\GreeterServer.csproj", "{DDBFF994-E076-43AD-B18D-049DFC1B670C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13B6DFC8-F5F6-4CC2-99DF-57A7CF042033}.Release|Any CPU.Build.0 = Release|Any CPU
{B754FB02-D501-4308-8B89-33AB7119C80D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B754FB02-D501-4308-8B89-33AB7119C80D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B754FB02-D501-4308-8B89-33AB7119C80D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B754FB02-D501-4308-8B89-33AB7119C80D}.Release|Any CPU.Build.0 = Release|Any CPU
{DDBFF994-E076-43AD-B18D-049DFC1B670C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDBFF994-E076-43AD-B18D-049DFC1B670C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDBFF994-E076-43AD-B18D-049DFC1B670C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDBFF994-E076-43AD-B18D-049DFC1B670C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyTitle>Greeter</AssemblyTitle>
<TargetFrameworks>netcoreapp1.0</TargetFrameworks>
<DebugType>portable</DebugType>
<AssemblyName>Greeter</AssemblyName>
<PackageId>Greeter</PackageId>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.2.0" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.2.0" />
<PackageReference Include="Grpc" Version="1.2.2" />
<PackageReference Include="Grpc.Tools" Version="1.2.2" />
</ItemGroup>
</Project>

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Helloworld { namespace Helloworld {
/// <summary>Holder for reflection information generated from helloworld.proto</summary> /// <summary>Holder for reflection information generated from helloworld.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class HelloworldReflection { public static partial class HelloworldReflection {
#region Descriptor #region Descriptor
@ -41,31 +40,36 @@ namespace Helloworld {
} }
#region Messages #region Messages
/// <summary> /// <summary>
/// The request message containing the user's name. /// The request message containing the user's name.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HelloRequest : pb::IMessage<HelloRequest> { public sealed partial class HelloRequest : pb::IMessage<HelloRequest> {
private static readonly pb::MessageParser<HelloRequest> _parser = new pb::MessageParser<HelloRequest>(() => new HelloRequest()); private static readonly pb::MessageParser<HelloRequest> _parser = new pb::MessageParser<HelloRequest>(() => new HelloRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<HelloRequest> Parser { get { return _parser; } } public static pb::MessageParser<HelloRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor { public static pbr::MessageDescriptor Descriptor {
get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[0]; } get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[0]; }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor { pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; } get { return Descriptor; }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloRequest() { public HelloRequest() {
OnConstruction(); OnConstruction();
} }
partial void OnConstruction(); partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloRequest(HelloRequest other) : this() { public HelloRequest(HelloRequest other) : this() {
name_ = other.name_; name_ = other.name_;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloRequest Clone() { public HelloRequest Clone() {
return new HelloRequest(this); return new HelloRequest(this);
} }
@ -73,6 +77,7 @@ namespace Helloworld {
/// <summary>Field number for the "name" field.</summary> /// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1; public const int NameFieldNumber = 1;
private string name_ = ""; private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name { public string Name {
get { return name_; } get { return name_; }
set { set {
@ -80,10 +85,12 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) { public override bool Equals(object other) {
return Equals(other as HelloRequest); return Equals(other as HelloRequest);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(HelloRequest other) { public bool Equals(HelloRequest other) {
if (ReferenceEquals(other, null)) { if (ReferenceEquals(other, null)) {
return false; return false;
@ -95,16 +102,19 @@ namespace Helloworld {
return true; return true;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
return hash; return hash;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() { public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this); return pb::JsonFormatter.ToDiagnosticString(this);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
@ -112,6 +122,7 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name.Length != 0) { if (Name.Length != 0) {
@ -120,6 +131,7 @@ namespace Helloworld {
return size; return size;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(HelloRequest other) { public void MergeFrom(HelloRequest other) {
if (other == null) { if (other == null) {
return; return;
@ -129,6 +141,7 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
@ -147,31 +160,36 @@ namespace Helloworld {
} }
/// <summary> /// <summary>
/// The response message containing the greetings /// The response message containing the greetings
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HelloReply : pb::IMessage<HelloReply> { public sealed partial class HelloReply : pb::IMessage<HelloReply> {
private static readonly pb::MessageParser<HelloReply> _parser = new pb::MessageParser<HelloReply>(() => new HelloReply()); private static readonly pb::MessageParser<HelloReply> _parser = new pb::MessageParser<HelloReply>(() => new HelloReply());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<HelloReply> Parser { get { return _parser; } } public static pb::MessageParser<HelloReply> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor { public static pbr::MessageDescriptor Descriptor {
get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[1]; } get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[1]; }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor { pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; } get { return Descriptor; }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloReply() { public HelloReply() {
OnConstruction(); OnConstruction();
} }
partial void OnConstruction(); partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloReply(HelloReply other) : this() { public HelloReply(HelloReply other) : this() {
message_ = other.message_; message_ = other.message_;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloReply Clone() { public HelloReply Clone() {
return new HelloReply(this); return new HelloReply(this);
} }
@ -179,6 +197,7 @@ namespace Helloworld {
/// <summary>Field number for the "message" field.</summary> /// <summary>Field number for the "message" field.</summary>
public const int MessageFieldNumber = 1; public const int MessageFieldNumber = 1;
private string message_ = ""; private string message_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Message { public string Message {
get { return message_; } get { return message_; }
set { set {
@ -186,10 +205,12 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) { public override bool Equals(object other) {
return Equals(other as HelloReply); return Equals(other as HelloReply);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(HelloReply other) { public bool Equals(HelloReply other) {
if (ReferenceEquals(other, null)) { if (ReferenceEquals(other, null)) {
return false; return false;
@ -201,16 +222,19 @@ namespace Helloworld {
return true; return true;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (Message.Length != 0) hash ^= Message.GetHashCode(); if (Message.Length != 0) hash ^= Message.GetHashCode();
return hash; return hash;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() { public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this); return pb::JsonFormatter.ToDiagnosticString(this);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Message.Length != 0) { if (Message.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
@ -218,6 +242,7 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Message.Length != 0) { if (Message.Length != 0) {
@ -226,6 +251,7 @@ namespace Helloworld {
return size; return size;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(HelloReply other) { public void MergeFrom(HelloReply other) {
if (other == null) { if (other == null) {
return; return;
@ -235,6 +261,7 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {

@ -35,21 +35,21 @@
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Grpc.Core; using grpc = global::Grpc.Core;
namespace Helloworld { namespace Helloworld {
/// <summary> /// <summary>
/// The greeting service definition. /// The greeting service definition.
/// </summary> /// </summary>
public static class Greeter public static partial class Greeter
{ {
static readonly string __ServiceName = "helloworld.Greeter"; static readonly string __ServiceName = "helloworld.Greeter";
static readonly Marshaller<global::Helloworld.HelloRequest> __Marshaller_HelloRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Helloworld.HelloRequest> __Marshaller_HelloRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom);
static readonly Marshaller<global::Helloworld.HelloReply> __Marshaller_HelloReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); static readonly grpc::Marshaller<global::Helloworld.HelloReply> __Marshaller_HelloReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom);
static readonly Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply> __Method_SayHello = new Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply>( static readonly grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply> __Method_SayHello = new grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply>(
MethodType.Unary, grpc::MethodType.Unary,
__ServiceName, __ServiceName,
"SayHello", "SayHello",
__Marshaller_HelloRequest, __Marshaller_HelloRequest,
@ -62,29 +62,32 @@ namespace Helloworld {
} }
/// <summary>Base class for server-side implementations of Greeter</summary> /// <summary>Base class for server-side implementations of Greeter</summary>
public abstract class GreeterBase public abstract partial class GreeterBase
{ {
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual global::System.Threading.Tasks.Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloRequest request, ServerCallContext context) /// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloRequest request, grpc::ServerCallContext context)
{ {
throw new RpcException(new Status(StatusCode.Unimplemented, "")); throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
} }
} }
/// <summary>Client for Greeter</summary> /// <summary>Client for Greeter</summary>
public class GreeterClient : ClientBase<GreeterClient> public partial class GreeterClient : grpc::ClientBase<GreeterClient>
{ {
/// <summary>Creates a new client for Greeter</summary> /// <summary>Creates a new client for Greeter</summary>
/// <param name="channel">The channel to use to make remote calls.</param> /// <param name="channel">The channel to use to make remote calls.</param>
public GreeterClient(Channel channel) : base(channel) public GreeterClient(grpc::Channel channel) : base(channel)
{ {
} }
/// <summary>Creates a new client for Greeter that uses a custom <c>CallInvoker</c>.</summary> /// <summary>Creates a new client for Greeter that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param> /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public GreeterClient(CallInvoker callInvoker) : base(callInvoker) public GreeterClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{ {
} }
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
@ -98,33 +101,50 @@ namespace Helloworld {
} }
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
return SayHello(request, new CallOptions(headers, deadline, cancellationToken)); return SayHello(request, new grpc::CallOptions(headers, deadline, cancellationToken));
} }
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options) /// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::CallOptions options)
{ {
return CallInvoker.BlockingUnaryCall(__Method_SayHello, null, options, request); return CallInvoker.BlockingUnaryCall(__Method_SayHello, null, options, request);
} }
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
return SayHelloAsync(request, new CallOptions(headers, deadline, cancellationToken)); return SayHelloAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
} }
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options) /// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::CallOptions options)
{ {
return CallInvoker.AsyncUnaryCall(__Method_SayHello, null, options, request); return CallInvoker.AsyncUnaryCall(__Method_SayHello, null, options, request);
} }
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override GreeterClient NewInstance(ClientBaseConfiguration configuration) protected override GreeterClient NewInstance(ClientBaseConfiguration configuration)
{ {
return new GreeterClient(configuration); return new GreeterClient(configuration);
@ -132,9 +152,10 @@ namespace Helloworld {
} }
/// <summary>Creates service definition that can be registered with a server</summary> /// <summary>Creates service definition that can be registered with a server</summary>
public static ServerServiceDefinition BindService(GreeterBase serviceImpl) /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(GreeterBase serviceImpl)
{ {
return ServerServiceDefinition.CreateBuilder() return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_SayHello, serviceImpl.SayHello).Build(); .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build();
} }

@ -1,31 +0,0 @@
{
"title": "Greeter",
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
},
"dependencies": {
"Google.Protobuf": "3.0.0",
"Grpc": "1.0.1",
},
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
},
"dependencies": {
"Microsoft.NETCore.Platforms": "1.0.1"
}
},
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
},
"imports": "dnxcore50"
}
}
}

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyTitle>GreeterClient</AssemblyTitle>
<TargetFrameworks>netcoreapp1.0</TargetFrameworks>
<DebugType>portable</DebugType>
<AssemblyName>GreeterClient</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>GreeterClient</PackageId>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Greeter\Greeter.csproj" />
</ItemGroup>
</Project>

@ -1,35 +0,0 @@
{
"title": "GreeterClient",
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": "true"
},
"dependencies": {
"Google.Protobuf": "3.0.0",
"Grpc": "1.0.1",
"Greeter": {
"target": "project"
}
},
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
},
"dependencies": {
"Microsoft.NETCore.Platforms": "1.0.1"
}
},
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
},
"imports": "dnxcore50"
}
}
}

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyTitle>GreeterServer</AssemblyTitle>
<TargetFrameworks>netcoreapp1.0</TargetFrameworks>
<DebugType>portable</DebugType>
<AssemblyName>GreeterServer</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>GreeterServer</PackageId>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Greeter\Greeter.csproj" />
</ItemGroup>
</Project>

@ -1,35 +0,0 @@
{
"title": "GreeterServer",
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": "true"
},
"dependencies": {
"Google.Protobuf": "3.0.0",
"Grpc": "1.0.1",
"Greeter": {
"target": "project"
}
},
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
},
"dependencies": {
"Microsoft.NETCore.Platforms": "1.0.1"
}
},
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
},
"imports": "dnxcore50"
}
}
}

@ -12,26 +12,19 @@ Example projects in this directory depend on the [Grpc](https://www.nuget.org/pa
and [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf/) NuGet packages and [Google.Protobuf](https://www.nuget.org/packages/Google.Protobuf/) NuGet packages
which have been already added to the project for you. which have been already added to the project for you.
The examples in this directory target .NET 4.5 framework, as .NET Core support is
currently experimental.
PREREQUISITES PREREQUISITES
------------- -------------
- The DotNetCore SDK cli. - The [.NET Core SDK](https://www.microsoft.com/net/core).
- The .NET 4.5 framework.
Both are available to download at https://www.microsoft.com/net/download
BUILD BUILD
------- -------
From the `examples/csharp/helloworld-from-cli` directory: From the `examples/csharp/helloworld-from-cli` directory:
- `dotnet restore` - `dotnet restore Greeter.sln`
- `dotnet build **/project.json` (this will automatically download NuGet dependencies) - `dotnet build Greeter.sln`
Try it! Try it!
------- -------
@ -40,14 +33,14 @@ Try it!
``` ```
> cd GreeterServer > cd GreeterServer
> dotnet run > dotnet run -f netcoreapp1.0
``` ```
- Run the client - Run the client
``` ```
> cd GreeterClient > cd GreeterClient
> dotnet run > dotnet run -f netcoreapp1.0
``` ```
Tutorial Tutorial

@ -0,0 +1,42 @@
@rem Copyright 2016, Google Inc.
@rem All rights reserved.
@rem
@rem Redistribution and use in source and binary forms, with or without
@rem modification, are permitted provided that the following conditions are
@rem met:
@rem
@rem * Redistributions of source code must retain the above copyright
@rem notice, this list of conditions and the following disclaimer.
@rem * Redistributions in binary form must reproduce the above
@rem copyright notice, this list of conditions and the following disclaimer
@rem in the documentation and/or other materials provided with the
@rem distribution.
@rem * Neither the name of Google Inc. nor the names of its
@rem contributors may be used to endorse or promote products derived from
@rem this software without specific prior written permission.
@rem
@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@rem Generate the C# code for .proto files
setlocal
@rem enter this directory
cd /d %~dp0
set PROTOC=%UserProfile%\.nuget\packages\Google.Protobuf.Tools\3.2.0\tools\windows_x64\protoc.exe
set PLUGIN=%UserProfile%\.nuget\packages\Grpc.Tools\1.2.2\tools\windows_x64\grpc_csharp_plugin.exe
%PROTOC% -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=%PLUGIN%
endlocal

@ -10,7 +10,8 @@
<RootNamespace>Greeter</RootNamespace> <RootNamespace>Greeter</RootNamespace>
<AssemblyName>Greeter</AssemblyName> <AssemblyName>Greeter</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>2669b4f2</NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -31,18 +32,18 @@
<ConsolePause>false</ConsolePause> <ConsolePause>false</ConsolePause>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.2.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=1.0.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll</HintPath>
<HintPath>..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
<HintPath>..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -61,11 +62,11 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<Import Project="..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" /> <Import Project="..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
</Project> </Project>

@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic;
namespace Helloworld { namespace Helloworld {
/// <summary>Holder for reflection information generated from helloworld.proto</summary> /// <summary>Holder for reflection information generated from helloworld.proto</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static partial class HelloworldReflection { public static partial class HelloworldReflection {
#region Descriptor #region Descriptor
@ -41,31 +40,36 @@ namespace Helloworld {
} }
#region Messages #region Messages
/// <summary> /// <summary>
/// The request message containing the user's name. /// The request message containing the user's name.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HelloRequest : pb::IMessage<HelloRequest> { public sealed partial class HelloRequest : pb::IMessage<HelloRequest> {
private static readonly pb::MessageParser<HelloRequest> _parser = new pb::MessageParser<HelloRequest>(() => new HelloRequest()); private static readonly pb::MessageParser<HelloRequest> _parser = new pb::MessageParser<HelloRequest>(() => new HelloRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<HelloRequest> Parser { get { return _parser; } } public static pb::MessageParser<HelloRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor { public static pbr::MessageDescriptor Descriptor {
get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[0]; } get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[0]; }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor { pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; } get { return Descriptor; }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloRequest() { public HelloRequest() {
OnConstruction(); OnConstruction();
} }
partial void OnConstruction(); partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloRequest(HelloRequest other) : this() { public HelloRequest(HelloRequest other) : this() {
name_ = other.name_; name_ = other.name_;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloRequest Clone() { public HelloRequest Clone() {
return new HelloRequest(this); return new HelloRequest(this);
} }
@ -73,6 +77,7 @@ namespace Helloworld {
/// <summary>Field number for the "name" field.</summary> /// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1; public const int NameFieldNumber = 1;
private string name_ = ""; private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name { public string Name {
get { return name_; } get { return name_; }
set { set {
@ -80,10 +85,12 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) { public override bool Equals(object other) {
return Equals(other as HelloRequest); return Equals(other as HelloRequest);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(HelloRequest other) { public bool Equals(HelloRequest other) {
if (ReferenceEquals(other, null)) { if (ReferenceEquals(other, null)) {
return false; return false;
@ -95,16 +102,19 @@ namespace Helloworld {
return true; return true;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
return hash; return hash;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() { public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this); return pb::JsonFormatter.ToDiagnosticString(this);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
@ -112,6 +122,7 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Name.Length != 0) { if (Name.Length != 0) {
@ -120,6 +131,7 @@ namespace Helloworld {
return size; return size;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(HelloRequest other) { public void MergeFrom(HelloRequest other) {
if (other == null) { if (other == null) {
return; return;
@ -129,6 +141,7 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
@ -147,31 +160,36 @@ namespace Helloworld {
} }
/// <summary> /// <summary>
/// The response message containing the greetings /// The response message containing the greetings
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public sealed partial class HelloReply : pb::IMessage<HelloReply> { public sealed partial class HelloReply : pb::IMessage<HelloReply> {
private static readonly pb::MessageParser<HelloReply> _parser = new pb::MessageParser<HelloReply>(() => new HelloReply()); private static readonly pb::MessageParser<HelloReply> _parser = new pb::MessageParser<HelloReply>(() => new HelloReply());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<HelloReply> Parser { get { return _parser; } } public static pb::MessageParser<HelloReply> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor { public static pbr::MessageDescriptor Descriptor {
get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[1]; } get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[1]; }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor { pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; } get { return Descriptor; }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloReply() { public HelloReply() {
OnConstruction(); OnConstruction();
} }
partial void OnConstruction(); partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloReply(HelloReply other) : this() { public HelloReply(HelloReply other) : this() {
message_ = other.message_; message_ = other.message_;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public HelloReply Clone() { public HelloReply Clone() {
return new HelloReply(this); return new HelloReply(this);
} }
@ -179,6 +197,7 @@ namespace Helloworld {
/// <summary>Field number for the "message" field.</summary> /// <summary>Field number for the "message" field.</summary>
public const int MessageFieldNumber = 1; public const int MessageFieldNumber = 1;
private string message_ = ""; private string message_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Message { public string Message {
get { return message_; } get { return message_; }
set { set {
@ -186,10 +205,12 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) { public override bool Equals(object other) {
return Equals(other as HelloReply); return Equals(other as HelloReply);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(HelloReply other) { public bool Equals(HelloReply other) {
if (ReferenceEquals(other, null)) { if (ReferenceEquals(other, null)) {
return false; return false;
@ -201,16 +222,19 @@ namespace Helloworld {
return true; return true;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() { public override int GetHashCode() {
int hash = 1; int hash = 1;
if (Message.Length != 0) hash ^= Message.GetHashCode(); if (Message.Length != 0) hash ^= Message.GetHashCode();
return hash; return hash;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() { public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this); return pb::JsonFormatter.ToDiagnosticString(this);
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
if (Message.Length != 0) { if (Message.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
@ -218,6 +242,7 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
if (Message.Length != 0) { if (Message.Length != 0) {
@ -226,6 +251,7 @@ namespace Helloworld {
return size; return size;
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(HelloReply other) { public void MergeFrom(HelloReply other) {
if (other == null) { if (other == null) {
return; return;
@ -235,6 +261,7 @@ namespace Helloworld {
} }
} }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {

@ -35,21 +35,21 @@
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Grpc.Core; using grpc = global::Grpc.Core;
namespace Helloworld { namespace Helloworld {
/// <summary> /// <summary>
/// The greeting service definition. /// The greeting service definition.
/// </summary> /// </summary>
public static class Greeter public static partial class Greeter
{ {
static readonly string __ServiceName = "helloworld.Greeter"; static readonly string __ServiceName = "helloworld.Greeter";
static readonly Marshaller<global::Helloworld.HelloRequest> __Marshaller_HelloRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom); static readonly grpc::Marshaller<global::Helloworld.HelloRequest> __Marshaller_HelloRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloRequest.Parser.ParseFrom);
static readonly Marshaller<global::Helloworld.HelloReply> __Marshaller_HelloReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom); static readonly grpc::Marshaller<global::Helloworld.HelloReply> __Marshaller_HelloReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Helloworld.HelloReply.Parser.ParseFrom);
static readonly Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply> __Method_SayHello = new Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply>( static readonly grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply> __Method_SayHello = new grpc::Method<global::Helloworld.HelloRequest, global::Helloworld.HelloReply>(
MethodType.Unary, grpc::MethodType.Unary,
__ServiceName, __ServiceName,
"SayHello", "SayHello",
__Marshaller_HelloRequest, __Marshaller_HelloRequest,
@ -62,29 +62,32 @@ namespace Helloworld {
} }
/// <summary>Base class for server-side implementations of Greeter</summary> /// <summary>Base class for server-side implementations of Greeter</summary>
public abstract class GreeterBase public abstract partial class GreeterBase
{ {
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual global::System.Threading.Tasks.Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloRequest request, ServerCallContext context) /// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Helloworld.HelloReply> SayHello(global::Helloworld.HelloRequest request, grpc::ServerCallContext context)
{ {
throw new RpcException(new Status(StatusCode.Unimplemented, "")); throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
} }
} }
/// <summary>Client for Greeter</summary> /// <summary>Client for Greeter</summary>
public class GreeterClient : ClientBase<GreeterClient> public partial class GreeterClient : grpc::ClientBase<GreeterClient>
{ {
/// <summary>Creates a new client for Greeter</summary> /// <summary>Creates a new client for Greeter</summary>
/// <param name="channel">The channel to use to make remote calls.</param> /// <param name="channel">The channel to use to make remote calls.</param>
public GreeterClient(Channel channel) : base(channel) public GreeterClient(grpc::Channel channel) : base(channel)
{ {
} }
/// <summary>Creates a new client for Greeter that uses a custom <c>CallInvoker</c>.</summary> /// <summary>Creates a new client for Greeter that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param> /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public GreeterClient(CallInvoker callInvoker) : base(callInvoker) public GreeterClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{ {
} }
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
@ -98,33 +101,50 @@ namespace Helloworld {
} }
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
return SayHello(request, new CallOptions(headers, deadline, cancellationToken)); return SayHello(request, new grpc::CallOptions(headers, deadline, cancellationToken));
} }
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options) /// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, grpc::CallOptions options)
{ {
return CallInvoker.BlockingUnaryCall(__Method_SayHello, null, options, request); return CallInvoker.BlockingUnaryCall(__Method_SayHello, null, options, request);
} }
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
return SayHelloAsync(request, new CallOptions(headers, deadline, cancellationToken)); return SayHelloAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
} }
/// <summary> /// <summary>
/// Sends a greeting /// Sends a greeting
/// </summary> /// </summary>
public virtual AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options) /// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Helloworld.HelloReply> SayHelloAsync(global::Helloworld.HelloRequest request, grpc::CallOptions options)
{ {
return CallInvoker.AsyncUnaryCall(__Method_SayHello, null, options, request); return CallInvoker.AsyncUnaryCall(__Method_SayHello, null, options, request);
} }
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override GreeterClient NewInstance(ClientBaseConfiguration configuration) protected override GreeterClient NewInstance(ClientBaseConfiguration configuration)
{ {
return new GreeterClient(configuration); return new GreeterClient(configuration);
@ -132,9 +152,10 @@ namespace Helloworld {
} }
/// <summary>Creates service definition that can be registered with a server</summary> /// <summary>Creates service definition that can be registered with a server</summary>
public static ServerServiceDefinition BindService(GreeterBase serviceImpl) /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(GreeterBase serviceImpl)
{ {
return ServerServiceDefinition.CreateBuilder() return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_SayHello, serviceImpl.SayHello).Build(); .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build();
} }

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" /> <package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="Grpc" version="1.0.1" targetFramework="net45" /> <package id="Grpc" version="1.2.2" targetFramework="net45" />
<package id="Grpc.Core" version="1.0.1" targetFramework="net45" /> <package id="Grpc.Core" version="1.2.2" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" /> <package id="Grpc.Tools" version="1.2.2" targetFramework="net45" />
<package id="Grpc.Tools" version="1.0.1" targetFramework="net45" /> <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
</packages> </packages>

@ -10,7 +10,8 @@
<RootNamespace>GreeterClient</RootNamespace> <RootNamespace>GreeterClient</RootNamespace>
<AssemblyName>GreeterClient</AssemblyName> <AssemblyName>GreeterClient</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>5e942a7d</NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -31,18 +32,18 @@
<Externalconsole>true</Externalconsole> <Externalconsole>true</Externalconsole>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.2.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=1.0.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll</HintPath>
<HintPath>..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
<HintPath>..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -59,11 +60,11 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" /> <Import Project="..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
</Project> </Project>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" /> <package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="Grpc" version="1.0.1" targetFramework="net45" /> <package id="Grpc" version="1.2.2" targetFramework="net45" />
<package id="Grpc.Core" version="1.0.1" targetFramework="net45" /> <package id="Grpc.Core" version="1.2.2" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" /> <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
</packages> </packages>

@ -10,7 +10,8 @@
<RootNamespace>GreeterServer</RootNamespace> <RootNamespace>GreeterServer</RootNamespace>
<AssemblyName>GreeterServer</AssemblyName> <AssemblyName>GreeterServer</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>9c7b2963</NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -31,18 +32,18 @@
<Externalconsole>true</Externalconsole> <Externalconsole>true</Externalconsole>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.2.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=1.0.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll</HintPath>
<HintPath>..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
<HintPath>..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -59,11 +60,11 @@
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" /> <Import Project="..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
</Project> </Project>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" /> <package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="Grpc" version="1.0.1" targetFramework="net45" /> <package id="Grpc" version="1.2.2" targetFramework="net45" />
<package id="Grpc.Core" version="1.0.1" targetFramework="net45" /> <package id="Grpc.Core" version="1.2.2" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" /> <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
</packages> </packages>

@ -34,7 +34,7 @@ setlocal
@rem enter this directory @rem enter this directory
cd /d %~dp0 cd /d %~dp0
set TOOLS_PATH=packages\Grpc.Tools.1.0.1\tools\windows_x86 set TOOLS_PATH=packages\Grpc.Tools.1.2.2\tools\windows_x86
%TOOLS_PATH%\protoc.exe -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe %TOOLS_PATH%\protoc.exe -I../../protos --csharp_out Greeter ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe

@ -1,4 +1,4 @@
#gRPC Basics: C# sample code # gRPC Basics: C# sample code
The files in this folder are the samples used in [gRPC Basics: C#][], The files in this folder are the samples used in [gRPC Basics: C#][],
a detailed tutorial for using gRPC in C#. a detailed tutorial for using gRPC in C#.

@ -53,10 +53,10 @@ namespace Routeguide {
} }
#region Messages #region Messages
/// <summary> /// <summary>
/// Points are represented as latitude-longitude pairs in the E7 representation /// Points are represented as latitude-longitude pairs in the E7 representation
/// (degrees multiplied by 10**7 and rounded to the nearest integer). /// (degrees multiplied by 10**7 and rounded to the nearest integer).
/// Latitudes should be in the range +/- 90 degrees and longitude should be in /// Latitudes should be in the range +/- 90 degrees and longitude should be in
/// the range +/- 180 degrees (inclusive). /// the range +/- 180 degrees (inclusive).
/// </summary> /// </summary>
public sealed partial class Point : pb::IMessage<Point> { public sealed partial class Point : pb::IMessage<Point> {
private static readonly pb::MessageParser<Point> _parser = new pb::MessageParser<Point>(() => new Point()); private static readonly pb::MessageParser<Point> _parser = new pb::MessageParser<Point>(() => new Point());
@ -204,8 +204,8 @@ namespace Routeguide {
} }
/// <summary> /// <summary>
/// A latitude-longitude rectangle, represented as two diagonally opposite /// A latitude-longitude rectangle, represented as two diagonally opposite
/// points "lo" and "hi". /// points "lo" and "hi".
/// </summary> /// </summary>
public sealed partial class Rectangle : pb::IMessage<Rectangle> { public sealed partial class Rectangle : pb::IMessage<Rectangle> {
private static readonly pb::MessageParser<Rectangle> _parser = new pb::MessageParser<Rectangle>(() => new Rectangle()); private static readonly pb::MessageParser<Rectangle> _parser = new pb::MessageParser<Rectangle>(() => new Rectangle());
@ -244,7 +244,7 @@ namespace Routeguide {
public const int LoFieldNumber = 1; public const int LoFieldNumber = 1;
private global::Routeguide.Point lo_; private global::Routeguide.Point lo_;
/// <summary> /// <summary>
/// One corner of the rectangle. /// One corner of the rectangle.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Routeguide.Point Lo { public global::Routeguide.Point Lo {
@ -258,7 +258,7 @@ namespace Routeguide {
public const int HiFieldNumber = 2; public const int HiFieldNumber = 2;
private global::Routeguide.Point hi_; private global::Routeguide.Point hi_;
/// <summary> /// <summary>
/// The other corner of the rectangle. /// The other corner of the rectangle.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Routeguide.Point Hi { public global::Routeguide.Point Hi {
@ -371,9 +371,9 @@ namespace Routeguide {
} }
/// <summary> /// <summary>
/// A feature names something at a given point. /// A feature names something at a given point.
/// ///
/// If a feature could not be named, the name is empty. /// If a feature could not be named, the name is empty.
/// </summary> /// </summary>
public sealed partial class Feature : pb::IMessage<Feature> { public sealed partial class Feature : pb::IMessage<Feature> {
private static readonly pb::MessageParser<Feature> _parser = new pb::MessageParser<Feature>(() => new Feature()); private static readonly pb::MessageParser<Feature> _parser = new pb::MessageParser<Feature>(() => new Feature());
@ -412,7 +412,7 @@ namespace Routeguide {
public const int NameFieldNumber = 1; public const int NameFieldNumber = 1;
private string name_ = ""; private string name_ = "";
/// <summary> /// <summary>
/// The name of the feature. /// The name of the feature.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name { public string Name {
@ -426,7 +426,7 @@ namespace Routeguide {
public const int LocationFieldNumber = 2; public const int LocationFieldNumber = 2;
private global::Routeguide.Point location_; private global::Routeguide.Point location_;
/// <summary> /// <summary>
/// The point where the feature is detected. /// The point where the feature is detected.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Routeguide.Point Location { public global::Routeguide.Point Location {
@ -533,7 +533,7 @@ namespace Routeguide {
} }
/// <summary> /// <summary>
/// A RouteNote is a message sent while at a given point. /// A RouteNote is a message sent while at a given point.
/// </summary> /// </summary>
public sealed partial class RouteNote : pb::IMessage<RouteNote> { public sealed partial class RouteNote : pb::IMessage<RouteNote> {
private static readonly pb::MessageParser<RouteNote> _parser = new pb::MessageParser<RouteNote>(() => new RouteNote()); private static readonly pb::MessageParser<RouteNote> _parser = new pb::MessageParser<RouteNote>(() => new RouteNote());
@ -572,7 +572,7 @@ namespace Routeguide {
public const int LocationFieldNumber = 1; public const int LocationFieldNumber = 1;
private global::Routeguide.Point location_; private global::Routeguide.Point location_;
/// <summary> /// <summary>
/// The location from which the message is sent. /// The location from which the message is sent.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Routeguide.Point Location { public global::Routeguide.Point Location {
@ -586,7 +586,7 @@ namespace Routeguide {
public const int MessageFieldNumber = 2; public const int MessageFieldNumber = 2;
private string message_ = ""; private string message_ = "";
/// <summary> /// <summary>
/// The message to be sent. /// The message to be sent.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Message { public string Message {
@ -693,11 +693,11 @@ namespace Routeguide {
} }
/// <summary> /// <summary>
/// A RouteSummary is received in response to a RecordRoute rpc. /// A RouteSummary is received in response to a RecordRoute rpc.
/// ///
/// It contains the number of individual points received, the number of /// It contains the number of individual points received, the number of
/// detected features, and the total distance covered as the cumulative sum of /// detected features, and the total distance covered as the cumulative sum of
/// the distance between each point. /// the distance between each point.
/// </summary> /// </summary>
public sealed partial class RouteSummary : pb::IMessage<RouteSummary> { public sealed partial class RouteSummary : pb::IMessage<RouteSummary> {
private static readonly pb::MessageParser<RouteSummary> _parser = new pb::MessageParser<RouteSummary>(() => new RouteSummary()); private static readonly pb::MessageParser<RouteSummary> _parser = new pb::MessageParser<RouteSummary>(() => new RouteSummary());
@ -738,7 +738,7 @@ namespace Routeguide {
public const int PointCountFieldNumber = 1; public const int PointCountFieldNumber = 1;
private int pointCount_; private int pointCount_;
/// <summary> /// <summary>
/// The number of points received. /// The number of points received.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int PointCount { public int PointCount {
@ -752,7 +752,7 @@ namespace Routeguide {
public const int FeatureCountFieldNumber = 2; public const int FeatureCountFieldNumber = 2;
private int featureCount_; private int featureCount_;
/// <summary> /// <summary>
/// The number of known features passed while traversing the route. /// The number of known features passed while traversing the route.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int FeatureCount { public int FeatureCount {
@ -766,7 +766,7 @@ namespace Routeguide {
public const int DistanceFieldNumber = 3; public const int DistanceFieldNumber = 3;
private int distance_; private int distance_;
/// <summary> /// <summary>
/// The distance covered in metres. /// The distance covered in metres.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Distance { public int Distance {
@ -780,7 +780,7 @@ namespace Routeguide {
public const int ElapsedTimeFieldNumber = 4; public const int ElapsedTimeFieldNumber = 4;
private int elapsedTime_; private int elapsedTime_;
/// <summary> /// <summary>
/// The duration of the traversal in seconds. /// The duration of the traversal in seconds.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ElapsedTime { public int ElapsedTime {

@ -11,7 +11,8 @@
<AssemblyName>RouteGuide</AssemblyName> <AssemblyName>RouteGuide</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>de2137f9</NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -31,13 +32,13 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.2.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=1.0.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll</HintPath>
<HintPath>..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -45,15 +46,15 @@
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
@ -74,12 +75,12 @@
</None> </None>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" /> <Import Project="..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
@ -88,4 +89,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

@ -35,45 +35,45 @@
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Grpc.Core; using grpc = global::Grpc.Core;
namespace Routeguide { namespace Routeguide {
/// <summary> /// <summary>
/// Interface exported by the server. /// Interface exported by the server.
/// </summary> /// </summary>
public static class RouteGuide public static partial class RouteGuide
{ {
static readonly string __ServiceName = "routeguide.RouteGuide"; static readonly string __ServiceName = "routeguide.RouteGuide";
static readonly Marshaller<global::Routeguide.Point> __Marshaller_Point = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Point.Parser.ParseFrom); static readonly grpc::Marshaller<global::Routeguide.Point> __Marshaller_Point = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Point.Parser.ParseFrom);
static readonly Marshaller<global::Routeguide.Feature> __Marshaller_Feature = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Feature.Parser.ParseFrom); static readonly grpc::Marshaller<global::Routeguide.Feature> __Marshaller_Feature = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Feature.Parser.ParseFrom);
static readonly Marshaller<global::Routeguide.Rectangle> __Marshaller_Rectangle = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Rectangle.Parser.ParseFrom); static readonly grpc::Marshaller<global::Routeguide.Rectangle> __Marshaller_Rectangle = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.Rectangle.Parser.ParseFrom);
static readonly Marshaller<global::Routeguide.RouteSummary> __Marshaller_RouteSummary = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteSummary.Parser.ParseFrom); static readonly grpc::Marshaller<global::Routeguide.RouteSummary> __Marshaller_RouteSummary = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteSummary.Parser.ParseFrom);
static readonly Marshaller<global::Routeguide.RouteNote> __Marshaller_RouteNote = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteNote.Parser.ParseFrom); static readonly grpc::Marshaller<global::Routeguide.RouteNote> __Marshaller_RouteNote = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Routeguide.RouteNote.Parser.ParseFrom);
static readonly Method<global::Routeguide.Point, global::Routeguide.Feature> __Method_GetFeature = new Method<global::Routeguide.Point, global::Routeguide.Feature>( static readonly grpc::Method<global::Routeguide.Point, global::Routeguide.Feature> __Method_GetFeature = new grpc::Method<global::Routeguide.Point, global::Routeguide.Feature>(
MethodType.Unary, grpc::MethodType.Unary,
__ServiceName, __ServiceName,
"GetFeature", "GetFeature",
__Marshaller_Point, __Marshaller_Point,
__Marshaller_Feature); __Marshaller_Feature);
static readonly Method<global::Routeguide.Rectangle, global::Routeguide.Feature> __Method_ListFeatures = new Method<global::Routeguide.Rectangle, global::Routeguide.Feature>( static readonly grpc::Method<global::Routeguide.Rectangle, global::Routeguide.Feature> __Method_ListFeatures = new grpc::Method<global::Routeguide.Rectangle, global::Routeguide.Feature>(
MethodType.ServerStreaming, grpc::MethodType.ServerStreaming,
__ServiceName, __ServiceName,
"ListFeatures", "ListFeatures",
__Marshaller_Rectangle, __Marshaller_Rectangle,
__Marshaller_Feature); __Marshaller_Feature);
static readonly Method<global::Routeguide.Point, global::Routeguide.RouteSummary> __Method_RecordRoute = new Method<global::Routeguide.Point, global::Routeguide.RouteSummary>( static readonly grpc::Method<global::Routeguide.Point, global::Routeguide.RouteSummary> __Method_RecordRoute = new grpc::Method<global::Routeguide.Point, global::Routeguide.RouteSummary>(
MethodType.ClientStreaming, grpc::MethodType.ClientStreaming,
__ServiceName, __ServiceName,
"RecordRoute", "RecordRoute",
__Marshaller_Point, __Marshaller_Point,
__Marshaller_RouteSummary); __Marshaller_RouteSummary);
static readonly Method<global::Routeguide.RouteNote, global::Routeguide.RouteNote> __Method_RouteChat = new Method<global::Routeguide.RouteNote, global::Routeguide.RouteNote>( static readonly grpc::Method<global::Routeguide.RouteNote, global::Routeguide.RouteNote> __Method_RouteChat = new grpc::Method<global::Routeguide.RouteNote, global::Routeguide.RouteNote>(
MethodType.DuplexStreaming, grpc::MethodType.DuplexStreaming,
__ServiceName, __ServiceName,
"RouteChat", "RouteChat",
__Marshaller_RouteNote, __Marshaller_RouteNote,
@ -86,69 +86,83 @@ namespace Routeguide {
} }
/// <summary>Base class for server-side implementations of RouteGuide</summary> /// <summary>Base class for server-side implementations of RouteGuide</summary>
public abstract class RouteGuideBase public abstract partial class RouteGuideBase
{ {
/// <summary> /// <summary>
/// A simple RPC. /// A simple RPC.
/// ///
/// Obtains the feature at a given position. /// Obtains the feature at a given position.
/// ///
/// A feature with an empty name is returned if there's no feature at the given /// A feature with an empty name is returned if there's no feature at the given
/// position. /// position.
/// </summary> /// </summary>
public virtual global::System.Threading.Tasks.Task<global::Routeguide.Feature> GetFeature(global::Routeguide.Point request, ServerCallContext context) /// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Routeguide.Feature> GetFeature(global::Routeguide.Point request, grpc::ServerCallContext context)
{ {
throw new RpcException(new Status(StatusCode.Unimplemented, "")); throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
} }
/// <summary> /// <summary>
/// A server-to-client streaming RPC. /// A server-to-client streaming RPC.
/// ///
/// Obtains the Features available within the given Rectangle. Results are /// Obtains the Features available within the given Rectangle. Results are
/// streamed rather than returned at once (e.g. in a response message with a /// streamed rather than returned at once (e.g. in a response message with a
/// repeated field), as the rectangle may cover a large area and contain a /// repeated field), as the rectangle may cover a large area and contain a
/// huge number of features. /// huge number of features.
/// </summary> /// </summary>
public virtual global::System.Threading.Tasks.Task ListFeatures(global::Routeguide.Rectangle request, IServerStreamWriter<global::Routeguide.Feature> responseStream, ServerCallContext context) /// <param name="request">The request received from the client.</param>
/// <param name="responseStream">Used for sending responses back to the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>A task indicating completion of the handler.</returns>
public virtual global::System.Threading.Tasks.Task ListFeatures(global::Routeguide.Rectangle request, grpc::IServerStreamWriter<global::Routeguide.Feature> responseStream, grpc::ServerCallContext context)
{ {
throw new RpcException(new Status(StatusCode.Unimplemented, "")); throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
} }
/// <summary> /// <summary>
/// A client-to-server streaming RPC. /// A client-to-server streaming RPC.
/// ///
/// Accepts a stream of Points on a route being traversed, returning a /// Accepts a stream of Points on a route being traversed, returning a
/// RouteSummary when traversal is completed. /// RouteSummary when traversal is completed.
/// </summary> /// </summary>
public virtual global::System.Threading.Tasks.Task<global::Routeguide.RouteSummary> RecordRoute(IAsyncStreamReader<global::Routeguide.Point> requestStream, ServerCallContext context) /// <param name="requestStream">Used for reading requests from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Routeguide.RouteSummary> RecordRoute(grpc::IAsyncStreamReader<global::Routeguide.Point> requestStream, grpc::ServerCallContext context)
{ {
throw new RpcException(new Status(StatusCode.Unimplemented, "")); throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
} }
/// <summary> /// <summary>
/// A Bidirectional streaming RPC. /// A Bidirectional streaming RPC.
/// ///
/// Accepts a stream of RouteNotes sent while a route is being traversed, /// Accepts a stream of RouteNotes sent while a route is being traversed,
/// while receiving other RouteNotes (e.g. from other users). /// while receiving other RouteNotes (e.g. from other users).
/// </summary> /// </summary>
public virtual global::System.Threading.Tasks.Task RouteChat(IAsyncStreamReader<global::Routeguide.RouteNote> requestStream, IServerStreamWriter<global::Routeguide.RouteNote> responseStream, ServerCallContext context) /// <param name="requestStream">Used for reading requests from the client.</param>
/// <param name="responseStream">Used for sending responses back to the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>A task indicating completion of the handler.</returns>
public virtual global::System.Threading.Tasks.Task RouteChat(grpc::IAsyncStreamReader<global::Routeguide.RouteNote> requestStream, grpc::IServerStreamWriter<global::Routeguide.RouteNote> responseStream, grpc::ServerCallContext context)
{ {
throw new RpcException(new Status(StatusCode.Unimplemented, "")); throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
} }
} }
/// <summary>Client for RouteGuide</summary> /// <summary>Client for RouteGuide</summary>
public class RouteGuideClient : ClientBase<RouteGuideClient> public partial class RouteGuideClient : grpc::ClientBase<RouteGuideClient>
{ {
/// <summary>Creates a new client for RouteGuide</summary> /// <summary>Creates a new client for RouteGuide</summary>
/// <param name="channel">The channel to use to make remote calls.</param> /// <param name="channel">The channel to use to make remote calls.</param>
public RouteGuideClient(Channel channel) : base(channel) public RouteGuideClient(grpc::Channel channel) : base(channel)
{ {
} }
/// <summary>Creates a new client for RouteGuide that uses a custom <c>CallInvoker</c>.</summary> /// <summary>Creates a new client for RouteGuide that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param> /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public RouteGuideClient(CallInvoker callInvoker) : base(callInvoker) public RouteGuideClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{ {
} }
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
@ -162,117 +176,154 @@ namespace Routeguide {
} }
/// <summary> /// <summary>
/// A simple RPC. /// A simple RPC.
/// ///
/// Obtains the feature at a given position. /// Obtains the feature at a given position.
/// ///
/// A feature with an empty name is returned if there's no feature at the given /// A feature with an empty name is returned if there's no feature at the given
/// position. /// position.
/// </summary> /// </summary>
public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
return GetFeature(request, new CallOptions(headers, deadline, cancellationToken)); return GetFeature(request, new grpc::CallOptions(headers, deadline, cancellationToken));
} }
/// <summary> /// <summary>
/// A simple RPC. /// A simple RPC.
/// ///
/// Obtains the feature at a given position. /// Obtains the feature at a given position.
/// ///
/// A feature with an empty name is returned if there's no feature at the given /// A feature with an empty name is returned if there's no feature at the given
/// position. /// position.
/// </summary> /// </summary>
public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options) /// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Routeguide.Feature GetFeature(global::Routeguide.Point request, grpc::CallOptions options)
{ {
return CallInvoker.BlockingUnaryCall(__Method_GetFeature, null, options, request); return CallInvoker.BlockingUnaryCall(__Method_GetFeature, null, options, request);
} }
/// <summary> /// <summary>
/// A simple RPC. /// A simple RPC.
/// ///
/// Obtains the feature at a given position. /// Obtains the feature at a given position.
/// ///
/// A feature with an empty name is returned if there's no feature at the given /// A feature with an empty name is returned if there's no feature at the given
/// position. /// position.
/// </summary> /// </summary>
public virtual AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
return GetFeatureAsync(request, new CallOptions(headers, deadline, cancellationToken)); return GetFeatureAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
} }
/// <summary> /// <summary>
/// A simple RPC. /// A simple RPC.
/// ///
/// Obtains the feature at a given position. /// Obtains the feature at a given position.
/// ///
/// A feature with an empty name is returned if there's no feature at the given /// A feature with an empty name is returned if there's no feature at the given
/// position. /// position.
/// </summary> /// </summary>
public virtual AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, CallOptions options) /// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Routeguide.Feature> GetFeatureAsync(global::Routeguide.Point request, grpc::CallOptions options)
{ {
return CallInvoker.AsyncUnaryCall(__Method_GetFeature, null, options, request); return CallInvoker.AsyncUnaryCall(__Method_GetFeature, null, options, request);
} }
/// <summary> /// <summary>
/// A server-to-client streaming RPC. /// A server-to-client streaming RPC.
/// ///
/// Obtains the Features available within the given Rectangle. Results are /// Obtains the Features available within the given Rectangle. Results are
/// streamed rather than returned at once (e.g. in a response message with a /// streamed rather than returned at once (e.g. in a response message with a
/// repeated field), as the rectangle may cover a large area and contain a /// repeated field), as the rectangle may cover a large area and contain a
/// huge number of features. /// huge number of features.
/// </summary> /// </summary>
public virtual AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
return ListFeatures(request, new CallOptions(headers, deadline, cancellationToken)); return ListFeatures(request, new grpc::CallOptions(headers, deadline, cancellationToken));
} }
/// <summary> /// <summary>
/// A server-to-client streaming RPC. /// A server-to-client streaming RPC.
/// ///
/// Obtains the Features available within the given Rectangle. Results are /// Obtains the Features available within the given Rectangle. Results are
/// streamed rather than returned at once (e.g. in a response message with a /// streamed rather than returned at once (e.g. in a response message with a
/// repeated field), as the rectangle may cover a large area and contain a /// repeated field), as the rectangle may cover a large area and contain a
/// huge number of features. /// huge number of features.
/// </summary> /// </summary>
public virtual AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, CallOptions options) /// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncServerStreamingCall<global::Routeguide.Feature> ListFeatures(global::Routeguide.Rectangle request, grpc::CallOptions options)
{ {
return CallInvoker.AsyncServerStreamingCall(__Method_ListFeatures, null, options, request); return CallInvoker.AsyncServerStreamingCall(__Method_ListFeatures, null, options, request);
} }
/// <summary> /// <summary>
/// A client-to-server streaming RPC. /// A client-to-server streaming RPC.
/// ///
/// Accepts a stream of Points on a route being traversed, returning a /// Accepts a stream of Points on a route being traversed, returning a
/// RouteSummary when traversal is completed. /// RouteSummary when traversal is completed.
/// </summary> /// </summary>
public virtual AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
return RecordRoute(new CallOptions(headers, deadline, cancellationToken)); return RecordRoute(new grpc::CallOptions(headers, deadline, cancellationToken));
} }
/// <summary> /// <summary>
/// A client-to-server streaming RPC. /// A client-to-server streaming RPC.
/// ///
/// Accepts a stream of Points on a route being traversed, returning a /// Accepts a stream of Points on a route being traversed, returning a
/// RouteSummary when traversal is completed. /// RouteSummary when traversal is completed.
/// </summary> /// </summary>
public virtual AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(CallOptions options) /// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncClientStreamingCall<global::Routeguide.Point, global::Routeguide.RouteSummary> RecordRoute(grpc::CallOptions options)
{ {
return CallInvoker.AsyncClientStreamingCall(__Method_RecordRoute, null, options); return CallInvoker.AsyncClientStreamingCall(__Method_RecordRoute, null, options);
} }
/// <summary> /// <summary>
/// A Bidirectional streaming RPC. /// A Bidirectional streaming RPC.
/// ///
/// Accepts a stream of RouteNotes sent while a route is being traversed, /// Accepts a stream of RouteNotes sent while a route is being traversed,
/// while receiving other RouteNotes (e.g. from other users). /// while receiving other RouteNotes (e.g. from other users).
/// </summary> /// </summary>
public virtual AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{ {
return RouteChat(new CallOptions(headers, deadline, cancellationToken)); return RouteChat(new grpc::CallOptions(headers, deadline, cancellationToken));
} }
/// <summary> /// <summary>
/// A Bidirectional streaming RPC. /// A Bidirectional streaming RPC.
/// ///
/// Accepts a stream of RouteNotes sent while a route is being traversed, /// Accepts a stream of RouteNotes sent while a route is being traversed,
/// while receiving other RouteNotes (e.g. from other users). /// while receiving other RouteNotes (e.g. from other users).
/// </summary> /// </summary>
public virtual AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(CallOptions options) /// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncDuplexStreamingCall<global::Routeguide.RouteNote, global::Routeguide.RouteNote> RouteChat(grpc::CallOptions options)
{ {
return CallInvoker.AsyncDuplexStreamingCall(__Method_RouteChat, null, options); return CallInvoker.AsyncDuplexStreamingCall(__Method_RouteChat, null, options);
} }
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override RouteGuideClient NewInstance(ClientBaseConfiguration configuration) protected override RouteGuideClient NewInstance(ClientBaseConfiguration configuration)
{ {
return new RouteGuideClient(configuration); return new RouteGuideClient(configuration);
@ -280,9 +331,10 @@ namespace Routeguide {
} }
/// <summary>Creates service definition that can be registered with a server</summary> /// <summary>Creates service definition that can be registered with a server</summary>
public static ServerServiceDefinition BindService(RouteGuideBase serviceImpl) /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(RouteGuideBase serviceImpl)
{ {
return ServerServiceDefinition.CreateBuilder() return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_GetFeature, serviceImpl.GetFeature) .AddMethod(__Method_GetFeature, serviceImpl.GetFeature)
.AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures) .AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures)
.AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute) .AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute)

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" /> <package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="Grpc" version="1.0.1" targetFramework="net45" /> <package id="Grpc" version="1.2.2" targetFramework="net45" />
<package id="Grpc.Core" version="1.0.1" targetFramework="net45" /> <package id="Grpc.Core" version="1.2.2" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages> <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
</packages>

@ -11,7 +11,8 @@
<AssemblyName>RouteGuideClient</AssemblyName> <AssemblyName>RouteGuideClient</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>b880049a</NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -33,13 +34,13 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.2.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=1.0.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll</HintPath>
<HintPath>..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -47,9 +48,9 @@
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
<HintPath>..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
@ -71,12 +72,12 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" /> <Import Project="..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
@ -85,4 +86,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" /> <package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="Grpc" version="1.0.1" targetFramework="net45" /> <package id="Grpc" version="1.2.2" targetFramework="net45" />
<package id="Grpc.Core" version="1.0.1" targetFramework="net45" /> <package id="Grpc.Core" version="1.2.2" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
</packages> <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
</packages>

@ -11,7 +11,8 @@
<AssemblyName>RouteGuideServer</AssemblyName> <AssemblyName>RouteGuideServer</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>946ecc79</NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -33,13 +34,13 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.2.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Grpc.Core, Version=1.0.1.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL"> <Reference Include="Grpc.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Grpc.Core.1.2.2\lib\net45\Grpc.Core.dll</HintPath>
<HintPath>..\packages\Grpc.Core.1.0.1\lib\net45\Grpc.Core.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -47,15 +48,15 @@
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Interactive.Async, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
@ -72,12 +73,12 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" /> <Import Project="..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets" Condition="Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.0.1\build\net45\Grpc.Core.targets'))" /> <Error Condition="!Exists('..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Grpc.Core.1.2.2\build\net45\Grpc.Core.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
@ -86,4 +87,4 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" /> <package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="Grpc" version="1.0.1" targetFramework="net45" /> <package id="Grpc" version="1.2.2" targetFramework="net45" />
<package id="Grpc.Core" version="1.0.1" targetFramework="net45" /> <package id="Grpc.Core" version="1.2.2" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" /> <package id="Grpc.Tools" version="1.2.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" /> <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="Grpc.Tools" version="1.0.1" targetFramework="net45" /> <package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
</packages> </packages>

@ -34,7 +34,7 @@ setlocal
@rem enter this directory @rem enter this directory
cd /d %~dp0 cd /d %~dp0
set TOOLS_PATH=packages\Grpc.Tools.1.0.0\tools\windows_x86 set TOOLS_PATH=packages\Grpc.Tools.1.2.2\tools\windows_x86
%TOOLS_PATH%\protoc.exe -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe %TOOLS_PATH%\protoc.exe -I../../protos --csharp_out RouteGuide ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=%TOOLS_PATH%\grpc_csharp_plugin.exe

@ -1,4 +1,4 @@
#gRPC Basics: Node.js sample code # gRPC Basics: Node.js sample code
The files in this folder are the samples used in [gRPC Basics: Node.js][], a detailed tutorial for using gRPC in Node.js. The files in this folder are the samples used in [gRPC Basics: Node.js][], a detailed tutorial for using gRPC in Node.js.

@ -1,7 +1,8 @@
This is the static code generation variant of the Node examples. Code in these examples is pre-generated using protoc and the Node gRPC protoc plugin, and the generated code can be found in various `*_pb.js` files. The command line sequence for generating those files is as follows (assuming that `protoc` and `grpc_node_plugin` are present, and starting in the base directory of this package): This is the static code generation variant of the Node examples. Code in these examples is pre-generated using protoc and the Node gRPC protoc plugin, and the generated code can be found in various `*_pb.js` files. The command line sequence for generating those files is as follows (assuming that `protoc` and `grpc_node_plugin` are present, and starting in the directory which contains this README.md file):
```sh ```sh
cd ../protos cd ../../protos
protoc --js_out=import_style=commonjs,binary:../node/static_codegen/ --grpc_out=../node/static_codegen --plugin=protoc-gen-grpc=grpc_node_plugin helloworld.proto npm install -g grpc-tools
protoc --js_out=import_style=commonjs,binary:../node/static_codegen/route_guide/ --grpc_out=../node/static_codegen/route_guide/ --plugin=protoc-gen-grpc=grpc_node_plugin route_guide.proto grpc_tools_node_protoc --js_out=import_style=commonjs,binary:../node/static_codegen/ --grpc_out=../node/static_codegen --plugin=protoc-gen-grpc=`which grpc_tools_node_protoc_plugin` helloworld.proto
grpc_tools_node_protoc --js_out=import_style=commonjs,binary:../node/static_codegen/route_guide/ --grpc_out=../node/static_codegen/route_guide/ --plugin=protoc-gen-grpc=`which grpc_tools_node_protoc_plugin` route_guide.proto
``` ```

@ -1,4 +1,4 @@
#gRPC Basics: Node.js sample code # gRPC Basics: Node.js sample code
The files in this folder are the samples used in [gRPC Basics: Node.js][], a detailed tutorial for using gRPC in Node.js. The files in this folder are the samples used in [gRPC Basics: Node.js][], a detailed tutorial for using gRPC in Node.js.

@ -1,3 +1,3 @@
#OAuth2 on gRPC: Objective-C # OAuth2 on gRPC: Objective-C
This is the supporting code for the tutorial "[OAuth2 on gRPC: Objective-C](http://www.grpc.io/docs/tutorials/auth/oauth2-objective-c.html)." This is the supporting code for the tutorial "[OAuth2 on gRPC: Objective-C](http://www.grpc.io/docs/tutorials/auth/oauth2-objective-c.html)."

@ -1,4 +1,4 @@
#gRPC in 3 minutes (Objective-C) # gRPC in 3 minutes (Objective-C)
## Installation ## Installation

@ -1,4 +1,4 @@
#gRPC Basics: Objective-C # gRPC Basics: Objective-C
This is the supporting code for the tutorial "[gRPC Basics: Objective-C](http://www.grpc.io/docs/tutorials/basic/objective-c.html)." This is the supporting code for the tutorial "[gRPC Basics: Objective-C](http://www.grpc.io/docs/tutorials/basic/objective-c.html)."

@ -1,4 +1,4 @@
#gRPC Basics: PHP sample code # gRPC Basics: PHP sample code
The files in this folder are the samples used in [gRPC Basics: PHP][], The files in this folder are the samples used in [gRPC Basics: PHP][],
a detailed tutorial for using gRPC in PHP. a detailed tutorial for using gRPC in PHP.

@ -0,0 +1,25 @@
# Errors and Cancelletion code samples for grpc-ruby
The examples in this directory show use of grpc errors.
On the server side, errors are returned from service
implementations by raising a certain `GRPC::BadStatus` exception.
On the client side, GRPC errors get raised when either:
* the call completes (unary and client-streaming call types)
* the response `Enumerable` is iterated through (server-streaming and
bidi call types).
## To run the examples here:
Start the server:
```
> ruby error_examples_server.rb
```
Then run the client:
```
> ruby error_examples_client.rb
```

@ -0,0 +1,117 @@
#!/usr/bin/env ruby
# 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.
# Sample app that connects to an error-throwing implementation of
# Route Guide service.
#
# Usage: $ path/to/route_guide_client.rb
this_dir = File.expand_path(File.dirname(__FILE__))
lib_dir = File.join(File.dirname(this_dir), 'lib')
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
require 'grpc'
require 'route_guide_services_pb'
include Routeguide
def run_get_feature_expect_error(stub)
resp = stub.get_feature(Point.new)
end
def run_list_features_expect_error(stub)
resps = stub.list_features(Rectangle.new)
# NOOP iteration to pick up error
resps.each { }
end
def run_record_route_expect_error(stub)
stub.record_route([])
end
def run_route_chat_expect_error(stub)
resps = stub.route_chat([])
# NOOP iteration to pick up error
resps.each { }
end
def main
stub = RouteGuide::Stub.new('localhost:50051', :this_channel_is_insecure)
begin
run_get_feature_expect_error(stub)
rescue GRPC::BadStatus => e
puts "===== GetFeature exception: ====="
puts e.inspect
puts "e.code: #{e.code}"
puts "e.details: #{e.details}"
puts "e.metadata: #{e.metadata}"
puts "================================="
end
begin
run_list_features_expect_error(stub)
rescue GRPC::BadStatus => e
error = true
puts "===== ListFeatures exception: ====="
puts e.inspect
puts "e.code: #{e.code}"
puts "e.details: #{e.details}"
puts "e.metadata: #{e.metadata}"
puts "================================="
end
begin
run_route_chat_expect_error(stub)
rescue GRPC::BadStatus => e
puts "==== RouteChat exception: ===="
puts e.inspect
puts "e.code: #{e.code}"
puts "e.details: #{e.details}"
puts "e.metadata: #{e.metadata}"
puts "================================="
end
begin
run_record_route_expect_error(stub)
rescue GRPC::BadStatus => e
puts "==== RecordRoute exception: ===="
puts e.inspect
puts "e.code: #{e.code}"
puts "e.details: #{e.details}"
puts "e.metadata: #{e.metadata}"
puts "================================="
end
end
main

@ -0,0 +1,76 @@
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# 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.
# Error-throwing implementation of Route Guide service.
#
# Usage: $ path/to/route_guide_server.rb
this_dir = File.expand_path(File.dirname(__FILE__))
lib_dir = File.join(File.dirname(this_dir), 'lib')
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
require 'grpc'
require 'route_guide_services_pb'
include Routeguide
include GRPC::Core::StatusCodes
# CanellingandErrorReturningServiceImpl provides an implementation of the RouteGuide service.
class CancellingAndErrorReturningServerImpl < RouteGuide::Service
# def get_feature
# Note get_feature isn't implemented in this subclass, so the server
# will get a gRPC UNIMPLEMENTED error when it's called.
def list_features(rectangle, _call)
raise "string appears on the client in the 'details' field of a 'GRPC::Unknown' exception"
end
def record_route(call)
raise GRPC::BadStatus.new_status_exception(CANCELLED)
end
def route_chat(notes)
raise GRPC::BadStatus.new_status_exception(ABORTED, details = 'arbitrary', metadata = {somekey: 'val'})
end
end
def main
port = '0.0.0.0:50051'
s = GRPC::RpcServer.new
s.add_http2_port(port, :this_port_is_insecure)
GRPC.logger.info("... running insecurely on #{port}")
s.handle(CancellingAndErrorReturningServerImpl.new)
s.run_till_terminated
end
main

@ -1,4 +1,4 @@
#gRPC Basics: Ruby sample code # gRPC Basics: Ruby sample code
The files in this folder are the samples used in [gRPC Basics: Ruby][], The files in this folder are the samples used in [gRPC Basics: Ruby][],
a detailed tutorial for using gRPC in Ruby. a detailed tutorial for using gRPC in Ruby.

@ -37,7 +37,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC-Core' s.name = 'gRPC-Core'
version = '1.2.0-dev' version = '1.4.0-dev'
s.version = version s.version = version
s.summary = 'Core cross-platform gRPC library, written in C' s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'http://www.grpc.io' s.homepage = 'http://www.grpc.io'
@ -51,7 +51,7 @@ Pod::Spec.new do |s|
:submodules => true, :submodules => true,
} }
s.ios.deployment_target = '7.1' s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9' s.osx.deployment_target = '10.9'
s.requires_arc = false s.requires_arc = false
@ -104,6 +104,7 @@ Pod::Spec.new do |s|
} }
s.default_subspecs = 'Interface', 'Implementation' s.default_subspecs = 'Interface', 'Implementation'
s.compiler_flags = '-DGRPC_ARES=0'
# Like many other C libraries, gRPC-Core has its public headers under `include/<libname>/` and its # Like many other C libraries, gRPC-Core has its public headers under `include/<libname>/` and its
# sources and private headers in other directories outside `include/`. Cocoapods' linter doesn't # sources and private headers in other directories outside `include/`. Cocoapods' linter doesn't
@ -151,7 +152,6 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/gpr_slice.h', 'include/grpc/impl/codegen/gpr_slice.h',
'include/grpc/impl/codegen/gpr_types.h', 'include/grpc/impl/codegen/gpr_types.h',
'include/grpc/impl/codegen/port_platform.h', 'include/grpc/impl/codegen/port_platform.h',
'include/grpc/impl/codegen/slice.h',
'include/grpc/impl/codegen/sync.h', 'include/grpc/impl/codegen/sync.h',
'include/grpc/impl/codegen/sync_generic.h', 'include/grpc/impl/codegen/sync_generic.h',
'include/grpc/impl/codegen/sync_posix.h', 'include/grpc/impl/codegen/sync_posix.h',
@ -172,6 +172,7 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/exec_ctx_fwd.h', 'include/grpc/impl/codegen/exec_ctx_fwd.h',
'include/grpc/impl/codegen/grpc_types.h', 'include/grpc/impl/codegen/grpc_types.h',
'include/grpc/impl/codegen/propagation_bits.h', 'include/grpc/impl/codegen/propagation_bits.h',
'include/grpc/impl/codegen/slice.h',
'include/grpc/impl/codegen/status.h', 'include/grpc/impl/codegen/status.h',
'include/grpc/impl/codegen/atm.h', 'include/grpc/impl/codegen/atm.h',
'include/grpc/impl/codegen/atm_gcc_atomic.h', 'include/grpc/impl/codegen/atm_gcc_atomic.h',
@ -180,7 +181,6 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/gpr_slice.h', 'include/grpc/impl/codegen/gpr_slice.h',
'include/grpc/impl/codegen/gpr_types.h', 'include/grpc/impl/codegen/gpr_types.h',
'include/grpc/impl/codegen/port_platform.h', 'include/grpc/impl/codegen/port_platform.h',
'include/grpc/impl/codegen/slice.h',
'include/grpc/impl/codegen/sync.h', 'include/grpc/impl/codegen/sync.h',
'include/grpc/impl/codegen/sync_generic.h', 'include/grpc/impl/codegen/sync_generic.h',
'include/grpc/impl/codegen/sync_posix.h', 'include/grpc/impl/codegen/sync_posix.h',
@ -196,9 +196,14 @@ Pod::Spec.new do |s|
# To save you from scrolling, this is the last part of the podspec. # To save you from scrolling, this is the last part of the podspec.
ss.source_files = 'src/core/lib/profiling/timers.h', ss.source_files = 'src/core/lib/profiling/timers.h',
'src/core/lib/support/arena.h',
'src/core/lib/support/atomic.h',
'src/core/lib/support/atomic_with_atm.h',
'src/core/lib/support/atomic_with_std.h',
'src/core/lib/support/backoff.h', 'src/core/lib/support/backoff.h',
'src/core/lib/support/block_annotate.h', 'src/core/lib/support/block_annotate.h',
'src/core/lib/support/env.h', 'src/core/lib/support/env.h',
'src/core/lib/support/memory.h',
'src/core/lib/support/mpscq.h', 'src/core/lib/support/mpscq.h',
'src/core/lib/support/murmur_hash.h', 'src/core/lib/support/murmur_hash.h',
'src/core/lib/support/spinlock.h', 'src/core/lib/support/spinlock.h',
@ -211,6 +216,8 @@ Pod::Spec.new do |s|
'src/core/lib/profiling/basic_timers.c', 'src/core/lib/profiling/basic_timers.c',
'src/core/lib/profiling/stap_timers.c', 'src/core/lib/profiling/stap_timers.c',
'src/core/lib/support/alloc.c', 'src/core/lib/support/alloc.c',
'src/core/lib/support/arena.c',
'src/core/lib/support/atm.c',
'src/core/lib/support/avl.c', 'src/core/lib/support/avl.c',
'src/core/lib/support/backoff.c', 'src/core/lib/support/backoff.c',
'src/core/lib/support/cmdline.c', 'src/core/lib/support/cmdline.c',
@ -255,16 +262,11 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_args.h', 'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h', 'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h', 'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/compress_filter.h',
'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h', 'src/core/lib/channel/context.h',
'src/core/lib/channel/deadline_filter.h',
'src/core/lib/channel/handshaker.h', 'src/core/lib/channel/handshaker.h',
'src/core/lib/channel/handshaker_factory.h', 'src/core/lib/channel/handshaker_factory.h',
'src/core/lib/channel/handshaker_registry.h', 'src/core/lib/channel/handshaker_registry.h',
'src/core/lib/channel/http_client_filter.h',
'src/core/lib/channel/http_server_filter.h',
'src/core/lib/channel/message_size_filter.h',
'src/core/lib/compression/algorithm_metadata.h', 'src/core/lib/compression/algorithm_metadata.h',
'src/core/lib/compression/message_compress.h', 'src/core/lib/compression/message_compress.h',
'src/core/lib/debug/trace.h', 'src/core/lib/debug/trace.h',
@ -287,6 +289,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/iomgr_internal.h',
'src/core/lib/iomgr/iomgr_posix.h', 'src/core/lib/iomgr/iomgr_posix.h',
'src/core/lib/iomgr/load_file.h', 'src/core/lib/iomgr/load_file.h',
'src/core/lib/iomgr/lockfree_event.h',
'src/core/lib/iomgr/network_status_tracker.h', 'src/core/lib/iomgr/network_status_tracker.h',
'src/core/lib/iomgr/polling_entity.h', 'src/core/lib/iomgr/polling_entity.h',
'src/core/lib/iomgr/pollset.h', 'src/core/lib/iomgr/pollset.h',
@ -301,6 +304,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/sockaddr_posix.h', 'src/core/lib/iomgr/sockaddr_posix.h',
'src/core/lib/iomgr/sockaddr_utils.h', 'src/core/lib/iomgr/sockaddr_utils.h',
'src/core/lib/iomgr/sockaddr_windows.h', 'src/core/lib/iomgr/sockaddr_windows.h',
'src/core/lib/iomgr/socket_factory_posix.h',
'src/core/lib/iomgr/socket_mutator.h', 'src/core/lib/iomgr/socket_mutator.h',
'src/core/lib/iomgr/socket_utils.h', 'src/core/lib/iomgr/socket_utils.h',
'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_utils_posix.h',
@ -309,6 +313,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_client_posix.h',
'src/core/lib/iomgr/tcp_posix.h', 'src/core/lib/iomgr/tcp_posix.h',
'src/core/lib/iomgr/tcp_server.h', 'src/core/lib/iomgr/tcp_server.h',
'src/core/lib/iomgr/tcp_server_utils_posix.h',
'src/core/lib/iomgr/tcp_uv.h', 'src/core/lib/iomgr/tcp_uv.h',
'src/core/lib/iomgr/tcp_windows.h', 'src/core/lib/iomgr/tcp_windows.h',
'src/core/lib/iomgr/time_averaged_stats.h', 'src/core/lib/iomgr/time_averaged_stats.h',
@ -328,6 +333,7 @@ Pod::Spec.new do |s|
'src/core/lib/json/json_common.h', 'src/core/lib/json/json_common.h',
'src/core/lib/json/json_reader.h', 'src/core/lib/json/json_reader.h',
'src/core/lib/json/json_writer.h', 'src/core/lib/json/json_writer.h',
'src/core/lib/slice/b64.h',
'src/core/lib/slice/percent_encoding.h', 'src/core/lib/slice/percent_encoding.h',
'src/core/lib/slice/slice_hash_table.h', 'src/core/lib/slice/slice_hash_table.h',
'src/core/lib/slice/slice_internal.h', 'src/core/lib/slice/slice_internal.h',
@ -339,6 +345,7 @@ Pod::Spec.new do |s|
'src/core/lib/surface/channel_init.h', 'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h', 'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.h', 'src/core/lib/surface/completion_queue.h',
'src/core/lib/surface/completion_queue_factory.h',
'src/core/lib/surface/event_string.h', 'src/core/lib/surface/event_string.h',
'src/core/lib/surface/init.h', 'src/core/lib/surface/init.h',
'src/core/lib/surface/lame_client.h', 'src/core/lib/surface/lame_client.h',
@ -371,12 +378,16 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_encoder.h', 'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h', 'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_table.h', 'src/core/ext/transport/chttp2/transport/hpack_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h',
'src/core/ext/transport/chttp2/transport/incoming_metadata.h', 'src/core/ext/transport/chttp2/transport/incoming_metadata.h',
'src/core/ext/transport/chttp2/transport/internal.h', 'src/core/ext/transport/chttp2/transport/internal.h',
'src/core/ext/transport/chttp2/transport/stream_map.h', 'src/core/ext/transport/chttp2/transport/stream_map.h',
'src/core/ext/transport/chttp2/transport/varint.h', 'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/chttp2/alpn/alpn.h', 'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/filters/http/client/http_client_filter.h',
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/server/http_server_filter.h',
'src/core/lib/security/context/security_context.h', 'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/composite/composite_credentials.h', 'src/core/lib/security/credentials/composite/composite_credentials.h',
'src/core/lib/security/credentials/credentials.h', 'src/core/lib/security/credentials/credentials.h',
@ -395,43 +406,48 @@ Pod::Spec.new do |s|
'src/core/lib/security/transport/security_connector.h', 'src/core/lib/security/transport/security_connector.h',
'src/core/lib/security/transport/security_handshaker.h', 'src/core/lib/security/transport/security_handshaker.h',
'src/core/lib/security/transport/tsi_error.h', 'src/core/lib/security/transport/tsi_error.h',
'src/core/lib/security/util/b64.h',
'src/core/lib/security/util/json_util.h', 'src/core/lib/security/util/json_util.h',
'src/core/lib/tsi/fake_transport_security.h', 'src/core/tsi/fake_transport_security.h',
'src/core/lib/tsi/ssl_transport_security.h', 'src/core/tsi/ssl_transport_security.h',
'src/core/lib/tsi/ssl_types.h', 'src/core/tsi/ssl_types.h',
'src/core/lib/tsi/transport_security.h', 'src/core/tsi/transport_security.h',
'src/core/lib/tsi/transport_security_interface.h', 'src/core/tsi/transport_security_adapter.h',
'src/core/tsi/transport_security_interface.h',
'src/core/ext/transport/chttp2/server/chttp2_server.h', 'src/core/ext/transport/chttp2/server/chttp2_server.h',
'src/core/ext/client_channel/client_channel.h', 'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/client_channel/client_channel_factory.h', 'src/core/ext/filters/client_channel/client_channel_factory.h',
'src/core/ext/client_channel/connector.h', 'src/core/ext/filters/client_channel/connector.h',
'src/core/ext/client_channel/http_connect_handshaker.h', 'src/core/ext/filters/client_channel/http_connect_handshaker.h',
'src/core/ext/client_channel/http_proxy.h', 'src/core/ext/filters/client_channel/http_proxy.h',
'src/core/ext/client_channel/initial_connect_string.h', 'src/core/ext/filters/client_channel/lb_policy.h',
'src/core/ext/client_channel/lb_policy.h', 'src/core/ext/filters/client_channel/lb_policy_factory.h',
'src/core/ext/client_channel/lb_policy_factory.h', 'src/core/ext/filters/client_channel/lb_policy_registry.h',
'src/core/ext/client_channel/lb_policy_registry.h', 'src/core/ext/filters/client_channel/parse_address.h',
'src/core/ext/client_channel/parse_address.h', 'src/core/ext/filters/client_channel/proxy_mapper.h',
'src/core/ext/client_channel/proxy_mapper.h', 'src/core/ext/filters/client_channel/proxy_mapper_registry.h',
'src/core/ext/client_channel/proxy_mapper_registry.h', 'src/core/ext/filters/client_channel/resolver.h',
'src/core/ext/client_channel/resolver.h', 'src/core/ext/filters/client_channel/resolver_factory.h',
'src/core/ext/client_channel/resolver_factory.h', 'src/core/ext/filters/client_channel/resolver_registry.h',
'src/core/ext/client_channel/resolver_registry.h', 'src/core/ext/filters/client_channel/retry_throttle.h',
'src/core/ext/client_channel/subchannel.h', 'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/client_channel/subchannel_index.h', 'src/core/ext/filters/client_channel/subchannel_index.h',
'src/core/ext/client_channel/uri_parser.h', 'src/core/ext/filters/client_channel/uri_parser.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/lb_policy/grpclb/grpclb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h',
'src/core/ext/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'src/core/ext/lb_policy/grpclb/load_balancer_api.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h',
'third_party/nanopb/pb.h', 'third_party/nanopb/pb.h',
'third_party/nanopb/pb_common.h', 'third_party/nanopb/pb_common.h',
'third_party/nanopb/pb_decode.h', 'third_party/nanopb/pb_decode.h',
'third_party/nanopb/pb_encode.h', 'third_party/nanopb/pb_encode.h',
'src/core/ext/load_reporting/load_reporting.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/load_reporting/load_reporting_filter.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
'src/core/ext/filters/load_reporting/load_reporting.h',
'src/core/ext/filters/load_reporting/load_reporting_filter.h',
'src/core/ext/census/aggregation.h', 'src/core/ext/census/aggregation.h',
'src/core/ext/census/base_resources.h', 'src/core/ext/census/base_resources.h',
'src/core/ext/census/census_interface.h', 'src/core/ext/census/census_interface.h',
@ -448,19 +464,16 @@ Pod::Spec.new do |s|
'src/core/ext/census/trace_status.h', 'src/core/ext/census/trace_status.h',
'src/core/ext/census/trace_string.h', 'src/core/ext/census/trace_string.h',
'src/core/ext/census/tracing.h', 'src/core/ext/census/tracing.h',
'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h',
'src/core/lib/surface/init.c', 'src/core/lib/surface/init.c',
'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_args.c',
'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack.c',
'src/core/lib/channel/channel_stack_builder.c', 'src/core/lib/channel/channel_stack_builder.c',
'src/core/lib/channel/compress_filter.c',
'src/core/lib/channel/connected_channel.c', 'src/core/lib/channel/connected_channel.c',
'src/core/lib/channel/deadline_filter.c',
'src/core/lib/channel/handshaker.c', 'src/core/lib/channel/handshaker.c',
'src/core/lib/channel/handshaker_factory.c', 'src/core/lib/channel/handshaker_factory.c',
'src/core/lib/channel/handshaker_registry.c', 'src/core/lib/channel/handshaker_registry.c',
'src/core/lib/channel/http_client_filter.c',
'src/core/lib/channel/http_server_filter.c',
'src/core/lib/channel/message_size_filter.c',
'src/core/lib/compression/compression.c', 'src/core/lib/compression/compression.c',
'src/core/lib/compression/message_compress.c', 'src/core/lib/compression/message_compress.c',
'src/core/lib/debug/trace.c', 'src/core/lib/debug/trace.c',
@ -485,6 +498,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/iomgr_uv.c', 'src/core/lib/iomgr/iomgr_uv.c',
'src/core/lib/iomgr/iomgr_windows.c', 'src/core/lib/iomgr/iomgr_windows.c',
'src/core/lib/iomgr/load_file.c', 'src/core/lib/iomgr/load_file.c',
'src/core/lib/iomgr/lockfree_event.c',
'src/core/lib/iomgr/network_status_tracker.c', 'src/core/lib/iomgr/network_status_tracker.c',
'src/core/lib/iomgr/polling_entity.c', 'src/core/lib/iomgr/polling_entity.c',
'src/core/lib/iomgr/pollset_set_uv.c', 'src/core/lib/iomgr/pollset_set_uv.c',
@ -496,6 +510,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/resolve_address_windows.c', 'src/core/lib/iomgr/resolve_address_windows.c',
'src/core/lib/iomgr/resource_quota.c', 'src/core/lib/iomgr/resource_quota.c',
'src/core/lib/iomgr/sockaddr_utils.c', 'src/core/lib/iomgr/sockaddr_utils.c',
'src/core/lib/iomgr/socket_factory_posix.c',
'src/core/lib/iomgr/socket_mutator.c', 'src/core/lib/iomgr/socket_mutator.c',
'src/core/lib/iomgr/socket_utils_common_posix.c', 'src/core/lib/iomgr/socket_utils_common_posix.c',
'src/core/lib/iomgr/socket_utils_linux.c', 'src/core/lib/iomgr/socket_utils_linux.c',
@ -508,6 +523,9 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/tcp_client_windows.c', 'src/core/lib/iomgr/tcp_client_windows.c',
'src/core/lib/iomgr/tcp_posix.c', 'src/core/lib/iomgr/tcp_posix.c',
'src/core/lib/iomgr/tcp_server_posix.c', 'src/core/lib/iomgr/tcp_server_posix.c',
'src/core/lib/iomgr/tcp_server_utils_posix_common.c',
'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c',
'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c',
'src/core/lib/iomgr/tcp_server_uv.c', 'src/core/lib/iomgr/tcp_server_uv.c',
'src/core/lib/iomgr/tcp_server_windows.c', 'src/core/lib/iomgr/tcp_server_windows.c',
'src/core/lib/iomgr/tcp_uv.c', 'src/core/lib/iomgr/tcp_uv.c',
@ -530,6 +548,7 @@ Pod::Spec.new do |s|
'src/core/lib/json/json_reader.c', 'src/core/lib/json/json_reader.c',
'src/core/lib/json/json_string.c', 'src/core/lib/json/json_string.c',
'src/core/lib/json/json_writer.c', 'src/core/lib/json/json_writer.c',
'src/core/lib/slice/b64.c',
'src/core/lib/slice/percent_encoding.c', 'src/core/lib/slice/percent_encoding.c',
'src/core/lib/slice/slice.c', 'src/core/lib/slice/slice.c',
'src/core/lib/slice/slice_buffer.c', 'src/core/lib/slice/slice_buffer.c',
@ -548,8 +567,9 @@ Pod::Spec.new do |s|
'src/core/lib/surface/channel_ping.c', 'src/core/lib/surface/channel_ping.c',
'src/core/lib/surface/channel_stack_type.c', 'src/core/lib/surface/channel_stack_type.c',
'src/core/lib/surface/completion_queue.c', 'src/core/lib/surface/completion_queue.c',
'src/core/lib/surface/completion_queue_factory.c',
'src/core/lib/surface/event_string.c', 'src/core/lib/surface/event_string.c',
'src/core/lib/surface/lame_client.c', 'src/core/lib/surface/lame_client.cc',
'src/core/lib/surface/metadata_array.c', 'src/core/lib/surface/metadata_array.c',
'src/core/lib/surface/server.c', 'src/core/lib/surface/server.c',
'src/core/lib/surface/validate_metadata.c', 'src/core/lib/surface/validate_metadata.c',
@ -581,6 +601,7 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_encoder.c', 'src/core/ext/transport/chttp2/transport/hpack_encoder.c',
'src/core/ext/transport/chttp2/transport/hpack_parser.c', 'src/core/ext/transport/chttp2/transport/hpack_parser.c',
'src/core/ext/transport/chttp2/transport/hpack_table.c', 'src/core/ext/transport/chttp2/transport/hpack_table.c',
'src/core/ext/transport/chttp2/transport/http2_settings.c',
'src/core/ext/transport/chttp2/transport/huffsyms.c', 'src/core/ext/transport/chttp2/transport/huffsyms.c',
'src/core/ext/transport/chttp2/transport/incoming_metadata.c', 'src/core/ext/transport/chttp2/transport/incoming_metadata.c',
'src/core/ext/transport/chttp2/transport/parsing.c', 'src/core/ext/transport/chttp2/transport/parsing.c',
@ -589,6 +610,10 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/varint.c', 'src/core/ext/transport/chttp2/transport/varint.c',
'src/core/ext/transport/chttp2/transport/writing.c', 'src/core/ext/transport/chttp2/transport/writing.c',
'src/core/ext/transport/chttp2/alpn/alpn.c', 'src/core/ext/transport/chttp2/alpn/alpn.c',
'src/core/ext/filters/http/client/http_client_filter.c',
'src/core/ext/filters/http/http_filters_plugin.c',
'src/core/ext/filters/http/message_compress/message_compress_filter.c',
'src/core/ext/filters/http/server/http_server_filter.c',
'src/core/lib/http/httpcli_security_connector.c', 'src/core/lib/http/httpcli_security_connector.c',
'src/core/lib/security/context/security_context.c', 'src/core/lib/security/context/security_context.c',
'src/core/lib/security/credentials/composite/composite_credentials.c', 'src/core/lib/security/credentials/composite/composite_credentials.c',
@ -611,53 +636,58 @@ Pod::Spec.new do |s|
'src/core/lib/security/transport/security_handshaker.c', 'src/core/lib/security/transport/security_handshaker.c',
'src/core/lib/security/transport/server_auth_filter.c', 'src/core/lib/security/transport/server_auth_filter.c',
'src/core/lib/security/transport/tsi_error.c', 'src/core/lib/security/transport/tsi_error.c',
'src/core/lib/security/util/b64.c',
'src/core/lib/security/util/json_util.c', 'src/core/lib/security/util/json_util.c',
'src/core/lib/surface/init_secure.c', 'src/core/lib/surface/init_secure.c',
'src/core/lib/tsi/fake_transport_security.c', 'src/core/tsi/fake_transport_security.c',
'src/core/lib/tsi/ssl_transport_security.c', 'src/core/tsi/ssl_transport_security.c',
'src/core/lib/tsi/transport_security.c', 'src/core/tsi/transport_security.c',
'src/core/tsi/transport_security_adapter.c',
'src/core/ext/transport/chttp2/server/chttp2_server.c', 'src/core/ext/transport/chttp2/server/chttp2_server.c',
'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c', 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c',
'src/core/ext/client_channel/channel_connectivity.c', 'src/core/ext/filters/client_channel/channel_connectivity.c',
'src/core/ext/client_channel/client_channel.c', 'src/core/ext/filters/client_channel/client_channel.c',
'src/core/ext/client_channel/client_channel_factory.c', 'src/core/ext/filters/client_channel/client_channel_factory.c',
'src/core/ext/client_channel/client_channel_plugin.c', 'src/core/ext/filters/client_channel/client_channel_plugin.c',
'src/core/ext/client_channel/connector.c', 'src/core/ext/filters/client_channel/connector.c',
'src/core/ext/client_channel/default_initial_connect_string.c', 'src/core/ext/filters/client_channel/http_connect_handshaker.c',
'src/core/ext/client_channel/http_connect_handshaker.c', 'src/core/ext/filters/client_channel/http_proxy.c',
'src/core/ext/client_channel/http_proxy.c', 'src/core/ext/filters/client_channel/lb_policy.c',
'src/core/ext/client_channel/initial_connect_string.c', 'src/core/ext/filters/client_channel/lb_policy_factory.c',
'src/core/ext/client_channel/lb_policy.c', 'src/core/ext/filters/client_channel/lb_policy_registry.c',
'src/core/ext/client_channel/lb_policy_factory.c', 'src/core/ext/filters/client_channel/parse_address.c',
'src/core/ext/client_channel/lb_policy_registry.c', 'src/core/ext/filters/client_channel/proxy_mapper.c',
'src/core/ext/client_channel/parse_address.c', 'src/core/ext/filters/client_channel/proxy_mapper_registry.c',
'src/core/ext/client_channel/proxy_mapper.c', 'src/core/ext/filters/client_channel/resolver.c',
'src/core/ext/client_channel/proxy_mapper_registry.c', 'src/core/ext/filters/client_channel/resolver_factory.c',
'src/core/ext/client_channel/resolver.c', 'src/core/ext/filters/client_channel/resolver_registry.c',
'src/core/ext/client_channel/resolver_factory.c', 'src/core/ext/filters/client_channel/retry_throttle.c',
'src/core/ext/client_channel/resolver_registry.c', 'src/core/ext/filters/client_channel/subchannel.c',
'src/core/ext/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel_index.c',
'src/core/ext/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/uri_parser.c',
'src/core/ext/client_channel/uri_parser.c', 'src/core/ext/filters/deadline/deadline_filter.c',
'src/core/ext/transport/chttp2/client/chttp2_connector.c', 'src/core/ext/transport/chttp2/client/chttp2_connector.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c',
'src/core/ext/lb_policy/grpclb/grpclb.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c',
'src/core/ext/lb_policy/grpclb/grpclb_channel_secure.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c',
'src/core/ext/lb_policy/grpclb/load_balancer_api.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.c',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c',
'third_party/nanopb/pb_common.c', 'third_party/nanopb/pb_common.c',
'third_party/nanopb/pb_decode.c', 'third_party/nanopb/pb_decode.c',
'third_party/nanopb/pb_encode.c', 'third_party/nanopb/pb_encode.c',
'src/core/ext/lb_policy/pick_first/pick_first.c', 'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c', 'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c',
'src/core/ext/resolver/dns/native/dns_resolver.c', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c',
'src/core/ext/load_reporting/load_reporting.c', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c',
'src/core/ext/load_reporting/load_reporting_filter.c', 'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.c',
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/filters/load_reporting/load_reporting.c',
'src/core/ext/filters/load_reporting/load_reporting_filter.c',
'src/core/ext/census/base_resources.c', 'src/core/ext/census/base_resources.c',
'src/core/ext/census/context.c', 'src/core/ext/census/context.c',
'src/core/ext/census/gen/census.pb.c', 'src/core/ext/census/gen/census.pb.c',
@ -672,12 +702,19 @@ Pod::Spec.new do |s|
'src/core/ext/census/resource.c', 'src/core/ext/census/resource.c',
'src/core/ext/census/trace_context.c', 'src/core/ext/census/trace_context.c',
'src/core/ext/census/tracing.c', 'src/core/ext/census/tracing.c',
'src/core/ext/filters/max_age/max_age_filter.c',
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/plugin_registry/grpc_plugin_registry.c' 'src/core/plugin_registry/grpc_plugin_registry.c'
ss.private_header_files = 'src/core/lib/profiling/timers.h', ss.private_header_files = 'src/core/lib/profiling/timers.h',
'src/core/lib/support/arena.h',
'src/core/lib/support/atomic.h',
'src/core/lib/support/atomic_with_atm.h',
'src/core/lib/support/atomic_with_std.h',
'src/core/lib/support/backoff.h', 'src/core/lib/support/backoff.h',
'src/core/lib/support/block_annotate.h', 'src/core/lib/support/block_annotate.h',
'src/core/lib/support/env.h', 'src/core/lib/support/env.h',
'src/core/lib/support/memory.h',
'src/core/lib/support/mpscq.h', 'src/core/lib/support/mpscq.h',
'src/core/lib/support/murmur_hash.h', 'src/core/lib/support/murmur_hash.h',
'src/core/lib/support/spinlock.h', 'src/core/lib/support/spinlock.h',
@ -690,16 +727,11 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_args.h', 'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h', 'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h', 'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/compress_filter.h',
'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h', 'src/core/lib/channel/context.h',
'src/core/lib/channel/deadline_filter.h',
'src/core/lib/channel/handshaker.h', 'src/core/lib/channel/handshaker.h',
'src/core/lib/channel/handshaker_factory.h', 'src/core/lib/channel/handshaker_factory.h',
'src/core/lib/channel/handshaker_registry.h', 'src/core/lib/channel/handshaker_registry.h',
'src/core/lib/channel/http_client_filter.h',
'src/core/lib/channel/http_server_filter.h',
'src/core/lib/channel/message_size_filter.h',
'src/core/lib/compression/algorithm_metadata.h', 'src/core/lib/compression/algorithm_metadata.h',
'src/core/lib/compression/message_compress.h', 'src/core/lib/compression/message_compress.h',
'src/core/lib/debug/trace.h', 'src/core/lib/debug/trace.h',
@ -722,6 +754,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/iomgr_internal.h',
'src/core/lib/iomgr/iomgr_posix.h', 'src/core/lib/iomgr/iomgr_posix.h',
'src/core/lib/iomgr/load_file.h', 'src/core/lib/iomgr/load_file.h',
'src/core/lib/iomgr/lockfree_event.h',
'src/core/lib/iomgr/network_status_tracker.h', 'src/core/lib/iomgr/network_status_tracker.h',
'src/core/lib/iomgr/polling_entity.h', 'src/core/lib/iomgr/polling_entity.h',
'src/core/lib/iomgr/pollset.h', 'src/core/lib/iomgr/pollset.h',
@ -736,6 +769,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/sockaddr_posix.h', 'src/core/lib/iomgr/sockaddr_posix.h',
'src/core/lib/iomgr/sockaddr_utils.h', 'src/core/lib/iomgr/sockaddr_utils.h',
'src/core/lib/iomgr/sockaddr_windows.h', 'src/core/lib/iomgr/sockaddr_windows.h',
'src/core/lib/iomgr/socket_factory_posix.h',
'src/core/lib/iomgr/socket_mutator.h', 'src/core/lib/iomgr/socket_mutator.h',
'src/core/lib/iomgr/socket_utils.h', 'src/core/lib/iomgr/socket_utils.h',
'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_utils_posix.h',
@ -744,6 +778,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_client_posix.h',
'src/core/lib/iomgr/tcp_posix.h', 'src/core/lib/iomgr/tcp_posix.h',
'src/core/lib/iomgr/tcp_server.h', 'src/core/lib/iomgr/tcp_server.h',
'src/core/lib/iomgr/tcp_server_utils_posix.h',
'src/core/lib/iomgr/tcp_uv.h', 'src/core/lib/iomgr/tcp_uv.h',
'src/core/lib/iomgr/tcp_windows.h', 'src/core/lib/iomgr/tcp_windows.h',
'src/core/lib/iomgr/time_averaged_stats.h', 'src/core/lib/iomgr/time_averaged_stats.h',
@ -763,6 +798,7 @@ Pod::Spec.new do |s|
'src/core/lib/json/json_common.h', 'src/core/lib/json/json_common.h',
'src/core/lib/json/json_reader.h', 'src/core/lib/json/json_reader.h',
'src/core/lib/json/json_writer.h', 'src/core/lib/json/json_writer.h',
'src/core/lib/slice/b64.h',
'src/core/lib/slice/percent_encoding.h', 'src/core/lib/slice/percent_encoding.h',
'src/core/lib/slice/slice_hash_table.h', 'src/core/lib/slice/slice_hash_table.h',
'src/core/lib/slice/slice_internal.h', 'src/core/lib/slice/slice_internal.h',
@ -774,6 +810,7 @@ Pod::Spec.new do |s|
'src/core/lib/surface/channel_init.h', 'src/core/lib/surface/channel_init.h',
'src/core/lib/surface/channel_stack_type.h', 'src/core/lib/surface/channel_stack_type.h',
'src/core/lib/surface/completion_queue.h', 'src/core/lib/surface/completion_queue.h',
'src/core/lib/surface/completion_queue_factory.h',
'src/core/lib/surface/event_string.h', 'src/core/lib/surface/event_string.h',
'src/core/lib/surface/init.h', 'src/core/lib/surface/init.h',
'src/core/lib/surface/lame_client.h', 'src/core/lib/surface/lame_client.h',
@ -806,12 +843,16 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_encoder.h', 'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h', 'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_table.h', 'src/core/ext/transport/chttp2/transport/hpack_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h',
'src/core/ext/transport/chttp2/transport/incoming_metadata.h', 'src/core/ext/transport/chttp2/transport/incoming_metadata.h',
'src/core/ext/transport/chttp2/transport/internal.h', 'src/core/ext/transport/chttp2/transport/internal.h',
'src/core/ext/transport/chttp2/transport/stream_map.h', 'src/core/ext/transport/chttp2/transport/stream_map.h',
'src/core/ext/transport/chttp2/transport/varint.h', 'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/chttp2/alpn/alpn.h', 'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/filters/http/client/http_client_filter.h',
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/server/http_server_filter.h',
'src/core/lib/security/context/security_context.h', 'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/composite/composite_credentials.h', 'src/core/lib/security/credentials/composite/composite_credentials.h',
'src/core/lib/security/credentials/credentials.h', 'src/core/lib/security/credentials/credentials.h',
@ -830,43 +871,48 @@ Pod::Spec.new do |s|
'src/core/lib/security/transport/security_connector.h', 'src/core/lib/security/transport/security_connector.h',
'src/core/lib/security/transport/security_handshaker.h', 'src/core/lib/security/transport/security_handshaker.h',
'src/core/lib/security/transport/tsi_error.h', 'src/core/lib/security/transport/tsi_error.h',
'src/core/lib/security/util/b64.h',
'src/core/lib/security/util/json_util.h', 'src/core/lib/security/util/json_util.h',
'src/core/lib/tsi/fake_transport_security.h', 'src/core/tsi/fake_transport_security.h',
'src/core/lib/tsi/ssl_transport_security.h', 'src/core/tsi/ssl_transport_security.h',
'src/core/lib/tsi/ssl_types.h', 'src/core/tsi/ssl_types.h',
'src/core/lib/tsi/transport_security.h', 'src/core/tsi/transport_security.h',
'src/core/lib/tsi/transport_security_interface.h', 'src/core/tsi/transport_security_adapter.h',
'src/core/tsi/transport_security_interface.h',
'src/core/ext/transport/chttp2/server/chttp2_server.h', 'src/core/ext/transport/chttp2/server/chttp2_server.h',
'src/core/ext/client_channel/client_channel.h', 'src/core/ext/filters/client_channel/client_channel.h',
'src/core/ext/client_channel/client_channel_factory.h', 'src/core/ext/filters/client_channel/client_channel_factory.h',
'src/core/ext/client_channel/connector.h', 'src/core/ext/filters/client_channel/connector.h',
'src/core/ext/client_channel/http_connect_handshaker.h', 'src/core/ext/filters/client_channel/http_connect_handshaker.h',
'src/core/ext/client_channel/http_proxy.h', 'src/core/ext/filters/client_channel/http_proxy.h',
'src/core/ext/client_channel/initial_connect_string.h', 'src/core/ext/filters/client_channel/lb_policy.h',
'src/core/ext/client_channel/lb_policy.h', 'src/core/ext/filters/client_channel/lb_policy_factory.h',
'src/core/ext/client_channel/lb_policy_factory.h', 'src/core/ext/filters/client_channel/lb_policy_registry.h',
'src/core/ext/client_channel/lb_policy_registry.h', 'src/core/ext/filters/client_channel/parse_address.h',
'src/core/ext/client_channel/parse_address.h', 'src/core/ext/filters/client_channel/proxy_mapper.h',
'src/core/ext/client_channel/proxy_mapper.h', 'src/core/ext/filters/client_channel/proxy_mapper_registry.h',
'src/core/ext/client_channel/proxy_mapper_registry.h', 'src/core/ext/filters/client_channel/resolver.h',
'src/core/ext/client_channel/resolver.h', 'src/core/ext/filters/client_channel/resolver_factory.h',
'src/core/ext/client_channel/resolver_factory.h', 'src/core/ext/filters/client_channel/resolver_registry.h',
'src/core/ext/client_channel/resolver_registry.h', 'src/core/ext/filters/client_channel/retry_throttle.h',
'src/core/ext/client_channel/subchannel.h', 'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/client_channel/subchannel_index.h', 'src/core/ext/filters/client_channel/subchannel_index.h',
'src/core/ext/client_channel/uri_parser.h', 'src/core/ext/filters/client_channel/uri_parser.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/lb_policy/grpclb/grpclb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h',
'src/core/ext/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'src/core/ext/lb_policy/grpclb/load_balancer_api.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h',
'third_party/nanopb/pb.h', 'third_party/nanopb/pb.h',
'third_party/nanopb/pb_common.h', 'third_party/nanopb/pb_common.h',
'third_party/nanopb/pb_decode.h', 'third_party/nanopb/pb_decode.h',
'third_party/nanopb/pb_encode.h', 'third_party/nanopb/pb_encode.h',
'src/core/ext/load_reporting/load_reporting.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h',
'src/core/ext/load_reporting/load_reporting_filter.h', 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h',
'src/core/ext/filters/load_reporting/load_reporting.h',
'src/core/ext/filters/load_reporting/load_reporting_filter.h',
'src/core/ext/census/aggregation.h', 'src/core/ext/census/aggregation.h',
'src/core/ext/census/base_resources.h', 'src/core/ext/census/base_resources.h',
'src/core/ext/census/census_interface.h', 'src/core/ext/census/census_interface.h',
@ -882,13 +928,14 @@ Pod::Spec.new do |s|
'src/core/ext/census/trace_propagation.h', 'src/core/ext/census/trace_propagation.h',
'src/core/ext/census/trace_status.h', 'src/core/ext/census/trace_status.h',
'src/core/ext/census/trace_string.h', 'src/core/ext/census/trace_string.h',
'src/core/ext/census/tracing.h' 'src/core/ext/census/tracing.h',
'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h'
end end
s.subspec 'Cronet-Interface' do |ss| s.subspec 'Cronet-Interface' do |ss|
ss.header_mappings_dir = 'include/grpc' ss.header_mappings_dir = 'include/grpc'
ss.source_files = 'include/grpc/grpc_cronet.h', ss.source_files = 'include/grpc/grpc_cronet.h'
'src/core/ext/transport/cronet/transport/cronet_transport.h'
end end
s.subspec 'Cronet-Implementation' do |ss| s.subspec 'Cronet-Implementation' do |ss|
@ -899,7 +946,7 @@ Pod::Spec.new do |s|
ss.dependency "#{s.name}/Cronet-Interface", version ss.dependency "#{s.name}/Cronet-Interface", version
ss.source_files = 'src/core/ext/transport/cronet/client/secure/cronet_channel_create.c', ss.source_files = 'src/core/ext/transport/cronet/client/secure/cronet_channel_create.c',
'src/core/ext/transport/cronet/transport/cronet_transport.c', 'src/core/ext/transport/cronet/transport/cronet_transport.{c,h}',
'third_party/objective_c/Cronet/bidirectional_stream_c.h' 'third_party/objective_c/Cronet/bidirectional_stream_c.h'
end end
@ -914,7 +961,7 @@ Pod::Spec.new do |s|
'test/core/end2end/end2end_test_utils.c', 'test/core/end2end/end2end_test_utils.c',
'test/core/end2end/tests/*.{c,h}', 'test/core/end2end/tests/*.{c,h}',
'test/core/end2end/data/*.{c,h}', 'test/core/end2end/data/*.{c,h}',
'test/core/util/debugger_macros.c', 'test/core/util/debugger_macros.{c,h}',
'test/core/util/test_config.{c,h}', 'test/core/util/test_config.{c,h}',
'test/core/util/port.h', 'test/core/util/port.h',
'test/core/util/port.c', 'test/core/util/port.c',

@ -36,7 +36,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC' s.name = 'gRPC-ProtoRPC'
version = '1.2.0-dev' version = '1.4.0-dev'
s.version = version s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC' s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'http://www.grpc.io' s.homepage = 'http://www.grpc.io'
@ -48,7 +48,7 @@ Pod::Spec.new do |s|
:tag => "v#{version}", :tag => "v#{version}",
} }
s.ios.deployment_target = '7.1' s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9' s.osx.deployment_target = '10.9'
name = 'ProtoRPC' name = 'ProtoRPC'

@ -36,7 +36,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary' s.name = 'gRPC-RxLibrary'
version = '1.2.0-dev' version = '1.4.0-dev'
s.version = version s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.' s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'http://www.grpc.io' s.homepage = 'http://www.grpc.io'
@ -48,7 +48,7 @@ Pod::Spec.new do |s|
:tag => "v#{version}", :tag => "v#{version}",
} }
s.ios.deployment_target = '7.1' s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9' s.osx.deployment_target = '10.9'
name = 'RxLibrary' name = 'RxLibrary'

@ -35,7 +35,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC' s.name = 'gRPC'
version = '1.2.0-dev' version = '1.4.0-dev'
s.version = version s.version = version
s.summary = 'gRPC client library for iOS/OSX' s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'http://www.grpc.io' s.homepage = 'http://www.grpc.io'
@ -47,7 +47,7 @@ Pod::Spec.new do |s|
:tag => "v#{version}", :tag => "v#{version}",
} }
s.ios.deployment_target = '7.1' s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.9' s.osx.deployment_target = '10.9'
name = 'GRPCClient' name = 'GRPCClient'

@ -53,6 +53,9 @@ EXPORTS
grpc_shutdown grpc_shutdown
grpc_version_string grpc_version_string
grpc_g_stands_for grpc_g_stands_for
grpc_completion_queue_factory_lookup
grpc_completion_queue_create_for_next
grpc_completion_queue_create_for_pluck
grpc_completion_queue_create grpc_completion_queue_create
grpc_completion_queue_next grpc_completion_queue_next
grpc_completion_queue_pluck grpc_completion_queue_pluck
@ -67,9 +70,9 @@ EXPORTS
grpc_channel_ping grpc_channel_ping
grpc_channel_register_call grpc_channel_register_call
grpc_channel_create_registered_call grpc_channel_create_registered_call
grpc_call_arena_alloc
grpc_call_start_batch grpc_call_start_batch
grpc_call_get_peer grpc_call_get_peer
grpc_call_set_load_reporting_cost_context
grpc_census_call_set_context grpc_census_call_set_context
grpc_census_call_get_context grpc_census_call_get_context
grpc_channel_get_target grpc_channel_get_target
@ -79,13 +82,13 @@ EXPORTS
grpc_channel_destroy grpc_channel_destroy
grpc_call_cancel grpc_call_cancel
grpc_call_cancel_with_status grpc_call_cancel_with_status
grpc_call_destroy grpc_call_ref
grpc_call_unref
grpc_server_request_call grpc_server_request_call
grpc_server_register_method grpc_server_register_method
grpc_server_request_registered_call grpc_server_request_registered_call
grpc_server_create grpc_server_create
grpc_server_register_completion_queue grpc_server_register_completion_queue
grpc_server_register_non_listening_completion_queue
grpc_server_add_insecure_http2_port grpc_server_add_insecure_http2_port
grpc_server_start grpc_server_start
grpc_server_shutdown_and_notify grpc_server_shutdown_and_notify
@ -138,10 +141,12 @@ EXPORTS
grpc_server_credentials_set_auth_metadata_processor grpc_server_credentials_set_auth_metadata_processor
grpc_slice_ref grpc_slice_ref
grpc_slice_unref grpc_slice_unref
grpc_slice_copy
grpc_slice_new grpc_slice_new
grpc_slice_new_with_user_data grpc_slice_new_with_user_data
grpc_slice_new_with_len grpc_slice_new_with_len
grpc_slice_malloc grpc_slice_malloc
grpc_slice_malloc_large
grpc_slice_intern grpc_slice_intern
grpc_slice_from_copied_string grpc_slice_from_copied_string
grpc_slice_from_copied_buffer grpc_slice_from_copied_buffer
@ -150,6 +155,7 @@ EXPORTS
grpc_slice_sub grpc_slice_sub
grpc_slice_sub_no_ref grpc_slice_sub_no_ref
grpc_slice_split_tail grpc_slice_split_tail
grpc_slice_split_tail_maybe_ref
grpc_slice_split_head grpc_slice_split_head
grpc_empty_slice grpc_empty_slice
grpc_slice_default_hash_impl grpc_slice_default_hash_impl
@ -178,6 +184,7 @@ EXPORTS
grpc_slice_buffer_move_into grpc_slice_buffer_move_into
grpc_slice_buffer_trim_end grpc_slice_buffer_trim_end
grpc_slice_buffer_move_first grpc_slice_buffer_move_first
grpc_slice_buffer_move_first_no_ref
grpc_slice_buffer_move_first_into_buffer grpc_slice_buffer_move_first_into_buffer
grpc_slice_buffer_take_first grpc_slice_buffer_take_first
grpc_slice_buffer_undo_take_first grpc_slice_buffer_undo_take_first
@ -258,6 +265,7 @@ EXPORTS
gpr_ref_non_zero gpr_ref_non_zero
gpr_refn gpr_refn
gpr_unref gpr_unref
gpr_ref_is_unique
gpr_stats_init gpr_stats_init
gpr_stats_inc gpr_stats_inc
gpr_stats_read gpr_stats_read

@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.files += Dir.glob('include/grpc/**/*') s.files += Dir.glob('include/grpc/**/*')
s.test_files = Dir.glob('src/ruby/spec/**/*') s.test_files = Dir.glob('src/ruby/spec/**/*')
s.bindir = 'src/ruby/bin' s.bindir = 'src/ruby/bin'
s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb ) s.require_paths = %w( src/ruby/lib src/ruby/bin src/ruby/pb )
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.add_dependency 'google-protobuf', '~> 3.1' s.add_dependency 'google-protobuf', '~> 3.1'
@ -76,15 +76,19 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/gpr_slice.h ) s.files += %w( include/grpc/impl/codegen/gpr_slice.h )
s.files += %w( include/grpc/impl/codegen/gpr_types.h ) s.files += %w( include/grpc/impl/codegen/gpr_types.h )
s.files += %w( include/grpc/impl/codegen/port_platform.h ) s.files += %w( include/grpc/impl/codegen/port_platform.h )
s.files += %w( include/grpc/impl/codegen/slice.h )
s.files += %w( include/grpc/impl/codegen/sync.h ) s.files += %w( include/grpc/impl/codegen/sync.h )
s.files += %w( include/grpc/impl/codegen/sync_generic.h ) s.files += %w( include/grpc/impl/codegen/sync_generic.h )
s.files += %w( include/grpc/impl/codegen/sync_posix.h ) s.files += %w( include/grpc/impl/codegen/sync_posix.h )
s.files += %w( include/grpc/impl/codegen/sync_windows.h ) s.files += %w( include/grpc/impl/codegen/sync_windows.h )
s.files += %w( src/core/lib/profiling/timers.h ) s.files += %w( src/core/lib/profiling/timers.h )
s.files += %w( src/core/lib/support/arena.h )
s.files += %w( src/core/lib/support/atomic.h )
s.files += %w( src/core/lib/support/atomic_with_atm.h )
s.files += %w( src/core/lib/support/atomic_with_std.h )
s.files += %w( src/core/lib/support/backoff.h ) s.files += %w( src/core/lib/support/backoff.h )
s.files += %w( src/core/lib/support/block_annotate.h ) s.files += %w( src/core/lib/support/block_annotate.h )
s.files += %w( src/core/lib/support/env.h ) s.files += %w( src/core/lib/support/env.h )
s.files += %w( src/core/lib/support/memory.h )
s.files += %w( src/core/lib/support/mpscq.h ) s.files += %w( src/core/lib/support/mpscq.h )
s.files += %w( src/core/lib/support/murmur_hash.h ) s.files += %w( src/core/lib/support/murmur_hash.h )
s.files += %w( src/core/lib/support/spinlock.h ) s.files += %w( src/core/lib/support/spinlock.h )
@ -97,6 +101,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/profiling/basic_timers.c ) s.files += %w( src/core/lib/profiling/basic_timers.c )
s.files += %w( src/core/lib/profiling/stap_timers.c ) s.files += %w( src/core/lib/profiling/stap_timers.c )
s.files += %w( src/core/lib/support/alloc.c ) s.files += %w( src/core/lib/support/alloc.c )
s.files += %w( src/core/lib/support/arena.c )
s.files += %w( src/core/lib/support/atm.c )
s.files += %w( src/core/lib/support/avl.c ) s.files += %w( src/core/lib/support/avl.c )
s.files += %w( src/core/lib/support/backoff.c ) s.files += %w( src/core/lib/support/backoff.c )
s.files += %w( src/core/lib/support/cmdline.c ) s.files += %w( src/core/lib/support/cmdline.c )
@ -154,6 +160,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/exec_ctx_fwd.h ) s.files += %w( include/grpc/impl/codegen/exec_ctx_fwd.h )
s.files += %w( include/grpc/impl/codegen/grpc_types.h ) s.files += %w( include/grpc/impl/codegen/grpc_types.h )
s.files += %w( include/grpc/impl/codegen/propagation_bits.h ) s.files += %w( include/grpc/impl/codegen/propagation_bits.h )
s.files += %w( include/grpc/impl/codegen/slice.h )
s.files += %w( include/grpc/impl/codegen/status.h ) s.files += %w( include/grpc/impl/codegen/status.h )
s.files += %w( include/grpc/impl/codegen/atm.h ) s.files += %w( include/grpc/impl/codegen/atm.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h ) s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h )
@ -162,7 +169,6 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/gpr_slice.h ) s.files += %w( include/grpc/impl/codegen/gpr_slice.h )
s.files += %w( include/grpc/impl/codegen/gpr_types.h ) s.files += %w( include/grpc/impl/codegen/gpr_types.h )
s.files += %w( include/grpc/impl/codegen/port_platform.h ) s.files += %w( include/grpc/impl/codegen/port_platform.h )
s.files += %w( include/grpc/impl/codegen/slice.h )
s.files += %w( include/grpc/impl/codegen/sync.h ) s.files += %w( include/grpc/impl/codegen/sync.h )
s.files += %w( include/grpc/impl/codegen/sync_generic.h ) s.files += %w( include/grpc/impl/codegen/sync_generic.h )
s.files += %w( include/grpc/impl/codegen/sync_posix.h ) s.files += %w( include/grpc/impl/codegen/sync_posix.h )
@ -172,16 +178,11 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/channel/channel_args.h ) s.files += %w( src/core/lib/channel/channel_args.h )
s.files += %w( src/core/lib/channel/channel_stack.h ) s.files += %w( src/core/lib/channel/channel_stack.h )
s.files += %w( src/core/lib/channel/channel_stack_builder.h ) s.files += %w( src/core/lib/channel/channel_stack_builder.h )
s.files += %w( src/core/lib/channel/compress_filter.h )
s.files += %w( src/core/lib/channel/connected_channel.h ) s.files += %w( src/core/lib/channel/connected_channel.h )
s.files += %w( src/core/lib/channel/context.h ) s.files += %w( src/core/lib/channel/context.h )
s.files += %w( src/core/lib/channel/deadline_filter.h )
s.files += %w( src/core/lib/channel/handshaker.h ) s.files += %w( src/core/lib/channel/handshaker.h )
s.files += %w( src/core/lib/channel/handshaker_factory.h ) s.files += %w( src/core/lib/channel/handshaker_factory.h )
s.files += %w( src/core/lib/channel/handshaker_registry.h ) s.files += %w( src/core/lib/channel/handshaker_registry.h )
s.files += %w( src/core/lib/channel/http_client_filter.h )
s.files += %w( src/core/lib/channel/http_server_filter.h )
s.files += %w( src/core/lib/channel/message_size_filter.h )
s.files += %w( src/core/lib/compression/algorithm_metadata.h ) s.files += %w( src/core/lib/compression/algorithm_metadata.h )
s.files += %w( src/core/lib/compression/message_compress.h ) s.files += %w( src/core/lib/compression/message_compress.h )
s.files += %w( src/core/lib/debug/trace.h ) s.files += %w( src/core/lib/debug/trace.h )
@ -204,6 +205,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/iomgr_internal.h ) s.files += %w( src/core/lib/iomgr/iomgr_internal.h )
s.files += %w( src/core/lib/iomgr/iomgr_posix.h ) s.files += %w( src/core/lib/iomgr/iomgr_posix.h )
s.files += %w( src/core/lib/iomgr/load_file.h ) s.files += %w( src/core/lib/iomgr/load_file.h )
s.files += %w( src/core/lib/iomgr/lockfree_event.h )
s.files += %w( src/core/lib/iomgr/network_status_tracker.h ) s.files += %w( src/core/lib/iomgr/network_status_tracker.h )
s.files += %w( src/core/lib/iomgr/polling_entity.h ) s.files += %w( src/core/lib/iomgr/polling_entity.h )
s.files += %w( src/core/lib/iomgr/pollset.h ) s.files += %w( src/core/lib/iomgr/pollset.h )
@ -218,6 +220,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/sockaddr_posix.h ) s.files += %w( src/core/lib/iomgr/sockaddr_posix.h )
s.files += %w( src/core/lib/iomgr/sockaddr_utils.h ) s.files += %w( src/core/lib/iomgr/sockaddr_utils.h )
s.files += %w( src/core/lib/iomgr/sockaddr_windows.h ) s.files += %w( src/core/lib/iomgr/sockaddr_windows.h )
s.files += %w( src/core/lib/iomgr/socket_factory_posix.h )
s.files += %w( src/core/lib/iomgr/socket_mutator.h ) s.files += %w( src/core/lib/iomgr/socket_mutator.h )
s.files += %w( src/core/lib/iomgr/socket_utils.h ) s.files += %w( src/core/lib/iomgr/socket_utils.h )
s.files += %w( src/core/lib/iomgr/socket_utils_posix.h ) s.files += %w( src/core/lib/iomgr/socket_utils_posix.h )
@ -226,6 +229,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/tcp_client_posix.h ) s.files += %w( src/core/lib/iomgr/tcp_client_posix.h )
s.files += %w( src/core/lib/iomgr/tcp_posix.h ) s.files += %w( src/core/lib/iomgr/tcp_posix.h )
s.files += %w( src/core/lib/iomgr/tcp_server.h ) s.files += %w( src/core/lib/iomgr/tcp_server.h )
s.files += %w( src/core/lib/iomgr/tcp_server_utils_posix.h )
s.files += %w( src/core/lib/iomgr/tcp_uv.h ) s.files += %w( src/core/lib/iomgr/tcp_uv.h )
s.files += %w( src/core/lib/iomgr/tcp_windows.h ) s.files += %w( src/core/lib/iomgr/tcp_windows.h )
s.files += %w( src/core/lib/iomgr/time_averaged_stats.h ) s.files += %w( src/core/lib/iomgr/time_averaged_stats.h )
@ -245,6 +249,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/json/json_common.h ) s.files += %w( src/core/lib/json/json_common.h )
s.files += %w( src/core/lib/json/json_reader.h ) s.files += %w( src/core/lib/json/json_reader.h )
s.files += %w( src/core/lib/json/json_writer.h ) s.files += %w( src/core/lib/json/json_writer.h )
s.files += %w( src/core/lib/slice/b64.h )
s.files += %w( src/core/lib/slice/percent_encoding.h ) s.files += %w( src/core/lib/slice/percent_encoding.h )
s.files += %w( src/core/lib/slice/slice_hash_table.h ) s.files += %w( src/core/lib/slice/slice_hash_table.h )
s.files += %w( src/core/lib/slice/slice_internal.h ) s.files += %w( src/core/lib/slice/slice_internal.h )
@ -256,6 +261,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/surface/channel_init.h ) s.files += %w( src/core/lib/surface/channel_init.h )
s.files += %w( src/core/lib/surface/channel_stack_type.h ) s.files += %w( src/core/lib/surface/channel_stack_type.h )
s.files += %w( src/core/lib/surface/completion_queue.h ) s.files += %w( src/core/lib/surface/completion_queue.h )
s.files += %w( src/core/lib/surface/completion_queue_factory.h )
s.files += %w( src/core/lib/surface/event_string.h ) s.files += %w( src/core/lib/surface/event_string.h )
s.files += %w( src/core/lib/surface/init.h ) s.files += %w( src/core/lib/surface/init.h )
s.files += %w( src/core/lib/surface/lame_client.h ) s.files += %w( src/core/lib/surface/lame_client.h )
@ -288,12 +294,16 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.h ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.h ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.h ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.h )
s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.h )
s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.h ) s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.h )
s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.h ) s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.h )
s.files += %w( src/core/ext/transport/chttp2/transport/internal.h ) s.files += %w( src/core/ext/transport/chttp2/transport/internal.h )
s.files += %w( src/core/ext/transport/chttp2/transport/stream_map.h ) s.files += %w( src/core/ext/transport/chttp2/transport/stream_map.h )
s.files += %w( src/core/ext/transport/chttp2/transport/varint.h ) s.files += %w( src/core/ext/transport/chttp2/transport/varint.h )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.h ) s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.h )
s.files += %w( src/core/ext/filters/http/client/http_client_filter.h )
s.files += %w( src/core/ext/filters/http/message_compress/message_compress_filter.h )
s.files += %w( src/core/ext/filters/http/server/http_server_filter.h )
s.files += %w( src/core/lib/security/context/security_context.h ) s.files += %w( src/core/lib/security/context/security_context.h )
s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.h ) s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.h )
s.files += %w( src/core/lib/security/credentials/credentials.h ) s.files += %w( src/core/lib/security/credentials/credentials.h )
@ -312,43 +322,48 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/transport/security_connector.h ) s.files += %w( src/core/lib/security/transport/security_connector.h )
s.files += %w( src/core/lib/security/transport/security_handshaker.h ) s.files += %w( src/core/lib/security/transport/security_handshaker.h )
s.files += %w( src/core/lib/security/transport/tsi_error.h ) s.files += %w( src/core/lib/security/transport/tsi_error.h )
s.files += %w( src/core/lib/security/util/b64.h )
s.files += %w( src/core/lib/security/util/json_util.h ) s.files += %w( src/core/lib/security/util/json_util.h )
s.files += %w( src/core/lib/tsi/fake_transport_security.h ) s.files += %w( src/core/tsi/fake_transport_security.h )
s.files += %w( src/core/lib/tsi/ssl_transport_security.h ) s.files += %w( src/core/tsi/ssl_transport_security.h )
s.files += %w( src/core/lib/tsi/ssl_types.h ) s.files += %w( src/core/tsi/ssl_types.h )
s.files += %w( src/core/lib/tsi/transport_security.h ) s.files += %w( src/core/tsi/transport_security.h )
s.files += %w( src/core/lib/tsi/transport_security_interface.h ) s.files += %w( src/core/tsi/transport_security_adapter.h )
s.files += %w( src/core/tsi/transport_security_interface.h )
s.files += %w( src/core/ext/transport/chttp2/server/chttp2_server.h ) s.files += %w( src/core/ext/transport/chttp2/server/chttp2_server.h )
s.files += %w( src/core/ext/client_channel/client_channel.h ) s.files += %w( src/core/ext/filters/client_channel/client_channel.h )
s.files += %w( src/core/ext/client_channel/client_channel_factory.h ) s.files += %w( src/core/ext/filters/client_channel/client_channel_factory.h )
s.files += %w( src/core/ext/client_channel/connector.h ) s.files += %w( src/core/ext/filters/client_channel/connector.h )
s.files += %w( src/core/ext/client_channel/http_connect_handshaker.h ) s.files += %w( src/core/ext/filters/client_channel/http_connect_handshaker.h )
s.files += %w( src/core/ext/client_channel/http_proxy.h ) s.files += %w( src/core/ext/filters/client_channel/http_proxy.h )
s.files += %w( src/core/ext/client_channel/initial_connect_string.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy.h )
s.files += %w( src/core/ext/client_channel/lb_policy.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy_factory.h )
s.files += %w( src/core/ext/client_channel/lb_policy_factory.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy_registry.h )
s.files += %w( src/core/ext/client_channel/lb_policy_registry.h ) s.files += %w( src/core/ext/filters/client_channel/parse_address.h )
s.files += %w( src/core/ext/client_channel/parse_address.h ) s.files += %w( src/core/ext/filters/client_channel/proxy_mapper.h )
s.files += %w( src/core/ext/client_channel/proxy_mapper.h ) s.files += %w( src/core/ext/filters/client_channel/proxy_mapper_registry.h )
s.files += %w( src/core/ext/client_channel/proxy_mapper_registry.h ) s.files += %w( src/core/ext/filters/client_channel/resolver.h )
s.files += %w( src/core/ext/client_channel/resolver.h ) s.files += %w( src/core/ext/filters/client_channel/resolver_factory.h )
s.files += %w( src/core/ext/client_channel/resolver_factory.h ) s.files += %w( src/core/ext/filters/client_channel/resolver_registry.h )
s.files += %w( src/core/ext/client_channel/resolver_registry.h ) s.files += %w( src/core/ext/filters/client_channel/retry_throttle.h )
s.files += %w( src/core/ext/client_channel/subchannel.h ) s.files += %w( src/core/ext/filters/client_channel/subchannel.h )
s.files += %w( src/core/ext/client_channel/subchannel_index.h ) s.files += %w( src/core/ext/filters/client_channel/subchannel_index.h )
s.files += %w( src/core/ext/client_channel/uri_parser.h ) s.files += %w( src/core/ext/filters/client_channel/uri_parser.h )
s.files += %w( src/core/ext/filters/deadline/deadline_filter.h )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h )
s.files += %w( src/core/ext/lb_policy/grpclb/grpclb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h )
s.files += %w( src/core/ext/lb_policy/grpclb/grpclb_channel.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h )
s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h )
s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h )
s.files += %w( third_party/nanopb/pb.h ) s.files += %w( third_party/nanopb/pb.h )
s.files += %w( third_party/nanopb/pb_common.h ) s.files += %w( third_party/nanopb/pb_common.h )
s.files += %w( third_party/nanopb/pb_decode.h ) s.files += %w( third_party/nanopb/pb_decode.h )
s.files += %w( third_party/nanopb/pb_encode.h ) s.files += %w( third_party/nanopb/pb_encode.h )
s.files += %w( src/core/ext/load_reporting/load_reporting.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h )
s.files += %w( src/core/ext/load_reporting/load_reporting_filter.h ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h )
s.files += %w( src/core/ext/filters/load_reporting/load_reporting.h )
s.files += %w( src/core/ext/filters/load_reporting/load_reporting_filter.h )
s.files += %w( src/core/ext/census/aggregation.h ) s.files += %w( src/core/ext/census/aggregation.h )
s.files += %w( src/core/ext/census/base_resources.h ) s.files += %w( src/core/ext/census/base_resources.h )
s.files += %w( src/core/ext/census/census_interface.h ) s.files += %w( src/core/ext/census/census_interface.h )
@ -365,19 +380,16 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/census/trace_status.h ) s.files += %w( src/core/ext/census/trace_status.h )
s.files += %w( src/core/ext/census/trace_string.h ) s.files += %w( src/core/ext/census/trace_string.h )
s.files += %w( src/core/ext/census/tracing.h ) s.files += %w( src/core/ext/census/tracing.h )
s.files += %w( src/core/ext/filters/max_age/max_age_filter.h )
s.files += %w( src/core/ext/filters/message_size/message_size_filter.h )
s.files += %w( src/core/lib/surface/init.c ) s.files += %w( src/core/lib/surface/init.c )
s.files += %w( src/core/lib/channel/channel_args.c ) s.files += %w( src/core/lib/channel/channel_args.c )
s.files += %w( src/core/lib/channel/channel_stack.c ) s.files += %w( src/core/lib/channel/channel_stack.c )
s.files += %w( src/core/lib/channel/channel_stack_builder.c ) s.files += %w( src/core/lib/channel/channel_stack_builder.c )
s.files += %w( src/core/lib/channel/compress_filter.c )
s.files += %w( src/core/lib/channel/connected_channel.c ) s.files += %w( src/core/lib/channel/connected_channel.c )
s.files += %w( src/core/lib/channel/deadline_filter.c )
s.files += %w( src/core/lib/channel/handshaker.c ) s.files += %w( src/core/lib/channel/handshaker.c )
s.files += %w( src/core/lib/channel/handshaker_factory.c ) s.files += %w( src/core/lib/channel/handshaker_factory.c )
s.files += %w( src/core/lib/channel/handshaker_registry.c ) s.files += %w( src/core/lib/channel/handshaker_registry.c )
s.files += %w( src/core/lib/channel/http_client_filter.c )
s.files += %w( src/core/lib/channel/http_server_filter.c )
s.files += %w( src/core/lib/channel/message_size_filter.c )
s.files += %w( src/core/lib/compression/compression.c ) s.files += %w( src/core/lib/compression/compression.c )
s.files += %w( src/core/lib/compression/message_compress.c ) s.files += %w( src/core/lib/compression/message_compress.c )
s.files += %w( src/core/lib/debug/trace.c ) s.files += %w( src/core/lib/debug/trace.c )
@ -402,6 +414,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/iomgr_uv.c ) s.files += %w( src/core/lib/iomgr/iomgr_uv.c )
s.files += %w( src/core/lib/iomgr/iomgr_windows.c ) s.files += %w( src/core/lib/iomgr/iomgr_windows.c )
s.files += %w( src/core/lib/iomgr/load_file.c ) s.files += %w( src/core/lib/iomgr/load_file.c )
s.files += %w( src/core/lib/iomgr/lockfree_event.c )
s.files += %w( src/core/lib/iomgr/network_status_tracker.c ) s.files += %w( src/core/lib/iomgr/network_status_tracker.c )
s.files += %w( src/core/lib/iomgr/polling_entity.c ) s.files += %w( src/core/lib/iomgr/polling_entity.c )
s.files += %w( src/core/lib/iomgr/pollset_set_uv.c ) s.files += %w( src/core/lib/iomgr/pollset_set_uv.c )
@ -413,6 +426,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/resolve_address_windows.c ) s.files += %w( src/core/lib/iomgr/resolve_address_windows.c )
s.files += %w( src/core/lib/iomgr/resource_quota.c ) s.files += %w( src/core/lib/iomgr/resource_quota.c )
s.files += %w( src/core/lib/iomgr/sockaddr_utils.c ) s.files += %w( src/core/lib/iomgr/sockaddr_utils.c )
s.files += %w( src/core/lib/iomgr/socket_factory_posix.c )
s.files += %w( src/core/lib/iomgr/socket_mutator.c ) s.files += %w( src/core/lib/iomgr/socket_mutator.c )
s.files += %w( src/core/lib/iomgr/socket_utils_common_posix.c ) s.files += %w( src/core/lib/iomgr/socket_utils_common_posix.c )
s.files += %w( src/core/lib/iomgr/socket_utils_linux.c ) s.files += %w( src/core/lib/iomgr/socket_utils_linux.c )
@ -425,6 +439,9 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/tcp_client_windows.c ) s.files += %w( src/core/lib/iomgr/tcp_client_windows.c )
s.files += %w( src/core/lib/iomgr/tcp_posix.c ) s.files += %w( src/core/lib/iomgr/tcp_posix.c )
s.files += %w( src/core/lib/iomgr/tcp_server_posix.c ) s.files += %w( src/core/lib/iomgr/tcp_server_posix.c )
s.files += %w( src/core/lib/iomgr/tcp_server_utils_posix_common.c )
s.files += %w( src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c )
s.files += %w( src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c )
s.files += %w( src/core/lib/iomgr/tcp_server_uv.c ) s.files += %w( src/core/lib/iomgr/tcp_server_uv.c )
s.files += %w( src/core/lib/iomgr/tcp_server_windows.c ) s.files += %w( src/core/lib/iomgr/tcp_server_windows.c )
s.files += %w( src/core/lib/iomgr/tcp_uv.c ) s.files += %w( src/core/lib/iomgr/tcp_uv.c )
@ -447,6 +464,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/json/json_reader.c ) s.files += %w( src/core/lib/json/json_reader.c )
s.files += %w( src/core/lib/json/json_string.c ) s.files += %w( src/core/lib/json/json_string.c )
s.files += %w( src/core/lib/json/json_writer.c ) s.files += %w( src/core/lib/json/json_writer.c )
s.files += %w( src/core/lib/slice/b64.c )
s.files += %w( src/core/lib/slice/percent_encoding.c ) s.files += %w( src/core/lib/slice/percent_encoding.c )
s.files += %w( src/core/lib/slice/slice.c ) s.files += %w( src/core/lib/slice/slice.c )
s.files += %w( src/core/lib/slice/slice_buffer.c ) s.files += %w( src/core/lib/slice/slice_buffer.c )
@ -465,8 +483,9 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/surface/channel_ping.c ) s.files += %w( src/core/lib/surface/channel_ping.c )
s.files += %w( src/core/lib/surface/channel_stack_type.c ) s.files += %w( src/core/lib/surface/channel_stack_type.c )
s.files += %w( src/core/lib/surface/completion_queue.c ) s.files += %w( src/core/lib/surface/completion_queue.c )
s.files += %w( src/core/lib/surface/completion_queue_factory.c )
s.files += %w( src/core/lib/surface/event_string.c ) s.files += %w( src/core/lib/surface/event_string.c )
s.files += %w( src/core/lib/surface/lame_client.c ) s.files += %w( src/core/lib/surface/lame_client.cc )
s.files += %w( src/core/lib/surface/metadata_array.c ) s.files += %w( src/core/lib/surface/metadata_array.c )
s.files += %w( src/core/lib/surface/server.c ) s.files += %w( src/core/lib/surface/server.c )
s.files += %w( src/core/lib/surface/validate_metadata.c ) s.files += %w( src/core/lib/surface/validate_metadata.c )
@ -498,6 +517,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.c ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.c )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.c ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.c )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.c ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.c )
s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.c )
s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.c ) s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.c )
s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.c ) s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.c )
s.files += %w( src/core/ext/transport/chttp2/transport/parsing.c ) s.files += %w( src/core/ext/transport/chttp2/transport/parsing.c )
@ -506,6 +526,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/varint.c ) s.files += %w( src/core/ext/transport/chttp2/transport/varint.c )
s.files += %w( src/core/ext/transport/chttp2/transport/writing.c ) s.files += %w( src/core/ext/transport/chttp2/transport/writing.c )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.c ) s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.c )
s.files += %w( src/core/ext/filters/http/client/http_client_filter.c )
s.files += %w( src/core/ext/filters/http/http_filters_plugin.c )
s.files += %w( src/core/ext/filters/http/message_compress/message_compress_filter.c )
s.files += %w( src/core/ext/filters/http/server/http_server_filter.c )
s.files += %w( src/core/lib/http/httpcli_security_connector.c ) s.files += %w( src/core/lib/http/httpcli_security_connector.c )
s.files += %w( src/core/lib/security/context/security_context.c ) s.files += %w( src/core/lib/security/context/security_context.c )
s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.c ) s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.c )
@ -528,53 +552,58 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/transport/security_handshaker.c ) s.files += %w( src/core/lib/security/transport/security_handshaker.c )
s.files += %w( src/core/lib/security/transport/server_auth_filter.c ) s.files += %w( src/core/lib/security/transport/server_auth_filter.c )
s.files += %w( src/core/lib/security/transport/tsi_error.c ) s.files += %w( src/core/lib/security/transport/tsi_error.c )
s.files += %w( src/core/lib/security/util/b64.c )
s.files += %w( src/core/lib/security/util/json_util.c ) s.files += %w( src/core/lib/security/util/json_util.c )
s.files += %w( src/core/lib/surface/init_secure.c ) s.files += %w( src/core/lib/surface/init_secure.c )
s.files += %w( src/core/lib/tsi/fake_transport_security.c ) s.files += %w( src/core/tsi/fake_transport_security.c )
s.files += %w( src/core/lib/tsi/ssl_transport_security.c ) s.files += %w( src/core/tsi/ssl_transport_security.c )
s.files += %w( src/core/lib/tsi/transport_security.c ) s.files += %w( src/core/tsi/transport_security.c )
s.files += %w( src/core/tsi/transport_security_adapter.c )
s.files += %w( src/core/ext/transport/chttp2/server/chttp2_server.c ) s.files += %w( src/core/ext/transport/chttp2/server/chttp2_server.c )
s.files += %w( src/core/ext/transport/chttp2/client/secure/secure_channel_create.c ) s.files += %w( src/core/ext/transport/chttp2/client/secure/secure_channel_create.c )
s.files += %w( src/core/ext/client_channel/channel_connectivity.c ) s.files += %w( src/core/ext/filters/client_channel/channel_connectivity.c )
s.files += %w( src/core/ext/client_channel/client_channel.c ) s.files += %w( src/core/ext/filters/client_channel/client_channel.c )
s.files += %w( src/core/ext/client_channel/client_channel_factory.c ) s.files += %w( src/core/ext/filters/client_channel/client_channel_factory.c )
s.files += %w( src/core/ext/client_channel/client_channel_plugin.c ) s.files += %w( src/core/ext/filters/client_channel/client_channel_plugin.c )
s.files += %w( src/core/ext/client_channel/connector.c ) s.files += %w( src/core/ext/filters/client_channel/connector.c )
s.files += %w( src/core/ext/client_channel/default_initial_connect_string.c ) s.files += %w( src/core/ext/filters/client_channel/http_connect_handshaker.c )
s.files += %w( src/core/ext/client_channel/http_connect_handshaker.c ) s.files += %w( src/core/ext/filters/client_channel/http_proxy.c )
s.files += %w( src/core/ext/client_channel/http_proxy.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy.c )
s.files += %w( src/core/ext/client_channel/initial_connect_string.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy_factory.c )
s.files += %w( src/core/ext/client_channel/lb_policy.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy_registry.c )
s.files += %w( src/core/ext/client_channel/lb_policy_factory.c ) s.files += %w( src/core/ext/filters/client_channel/parse_address.c )
s.files += %w( src/core/ext/client_channel/lb_policy_registry.c ) s.files += %w( src/core/ext/filters/client_channel/proxy_mapper.c )
s.files += %w( src/core/ext/client_channel/parse_address.c ) s.files += %w( src/core/ext/filters/client_channel/proxy_mapper_registry.c )
s.files += %w( src/core/ext/client_channel/proxy_mapper.c ) s.files += %w( src/core/ext/filters/client_channel/resolver.c )
s.files += %w( src/core/ext/client_channel/proxy_mapper_registry.c ) s.files += %w( src/core/ext/filters/client_channel/resolver_factory.c )
s.files += %w( src/core/ext/client_channel/resolver.c ) s.files += %w( src/core/ext/filters/client_channel/resolver_registry.c )
s.files += %w( src/core/ext/client_channel/resolver_factory.c ) s.files += %w( src/core/ext/filters/client_channel/retry_throttle.c )
s.files += %w( src/core/ext/client_channel/resolver_registry.c ) s.files += %w( src/core/ext/filters/client_channel/subchannel.c )
s.files += %w( src/core/ext/client_channel/subchannel.c ) s.files += %w( src/core/ext/filters/client_channel/subchannel_index.c )
s.files += %w( src/core/ext/client_channel/subchannel_index.c ) s.files += %w( src/core/ext/filters/client_channel/uri_parser.c )
s.files += %w( src/core/ext/client_channel/uri_parser.c ) s.files += %w( src/core/ext/filters/deadline/deadline_filter.c )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.c ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.c )
s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c ) s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c )
s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c ) s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c )
s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.c ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.c )
s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c )
s.files += %w( src/core/ext/lb_policy/grpclb/grpclb.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c )
s.files += %w( src/core/ext/lb_policy/grpclb/grpclb_channel_secure.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c )
s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.c )
s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c )
s.files += %w( third_party/nanopb/pb_common.c ) s.files += %w( third_party/nanopb/pb_common.c )
s.files += %w( third_party/nanopb/pb_decode.c ) s.files += %w( third_party/nanopb/pb_decode.c )
s.files += %w( third_party/nanopb/pb_encode.c ) s.files += %w( third_party/nanopb/pb_encode.c )
s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c )
s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c )
s.files += %w( src/core/ext/resolver/dns/native/dns_resolver.c ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c )
s.files += %w( src/core/ext/resolver/sockaddr/sockaddr_resolver.c ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c )
s.files += %w( src/core/ext/load_reporting/load_reporting.c ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c )
s.files += %w( src/core/ext/load_reporting/load_reporting_filter.c ) s.files += %w( src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.c )
s.files += %w( src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.c )
s.files += %w( src/core/ext/filters/load_reporting/load_reporting.c )
s.files += %w( src/core/ext/filters/load_reporting/load_reporting_filter.c )
s.files += %w( src/core/ext/census/base_resources.c ) s.files += %w( src/core/ext/census/base_resources.c )
s.files += %w( src/core/ext/census/context.c ) s.files += %w( src/core/ext/census/context.c )
s.files += %w( src/core/ext/census/gen/census.pb.c ) s.files += %w( src/core/ext/census/gen/census.pb.c )
@ -589,6 +618,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/census/resource.c ) s.files += %w( src/core/ext/census/resource.c )
s.files += %w( src/core/ext/census/trace_context.c ) s.files += %w( src/core/ext/census/trace_context.c )
s.files += %w( src/core/ext/census/tracing.c ) s.files += %w( src/core/ext/census/tracing.c )
s.files += %w( src/core/ext/filters/max_age/max_age_filter.c )
s.files += %w( src/core/ext/filters/message_size/message_size_filter.c )
s.files += %w( src/core/plugin_registry/grpc_plugin_registry.c ) s.files += %w( src/core/plugin_registry/grpc_plugin_registry.c )
s.files += %w( third_party/boringssl/crypto/aes/internal.h ) s.files += %w( third_party/boringssl/crypto/aes/internal.h )
s.files += %w( third_party/boringssl/crypto/asn1/asn1_locl.h ) s.files += %w( third_party/boringssl/crypto/asn1/asn1_locl.h )
@ -1024,4 +1055,77 @@ Gem::Specification.new do |s|
s.files += %w( third_party/zlib/trees.c ) s.files += %w( third_party/zlib/trees.c )
s.files += %w( third_party/zlib/uncompr.c ) s.files += %w( third_party/zlib/uncompr.c )
s.files += %w( third_party/zlib/zutil.c ) s.files += %w( third_party/zlib/zutil.c )
s.files += %w( third_party/cares/cares/ares.h )
s.files += %w( third_party/cares/cares/ares_data.h )
s.files += %w( third_party/cares/cares/ares_dns.h )
s.files += %w( third_party/cares/cares/ares_getenv.h )
s.files += %w( third_party/cares/cares/ares_getopt.h )
s.files += %w( third_party/cares/cares/ares_inet_net_pton.h )
s.files += %w( third_party/cares/cares/ares_iphlpapi.h )
s.files += %w( third_party/cares/cares/ares_ipv6.h )
s.files += %w( third_party/cares/cares/ares_library_init.h )
s.files += %w( third_party/cares/cares/ares_llist.h )
s.files += %w( third_party/cares/cares/ares_nowarn.h )
s.files += %w( third_party/cares/cares/ares_platform.h )
s.files += %w( third_party/cares/cares/ares_private.h )
s.files += %w( third_party/cares/cares/ares_rules.h )
s.files += %w( third_party/cares/cares/ares_setup.h )
s.files += %w( third_party/cares/cares/ares_strcasecmp.h )
s.files += %w( third_party/cares/cares/ares_strdup.h )
s.files += %w( third_party/cares/cares/ares_version.h )
s.files += %w( third_party/cares/cares/bitncmp.h )
s.files += %w( third_party/cares/cares/config-win32.h )
s.files += %w( third_party/cares/cares/setup_once.h )
s.files += %w( third_party/cares/ares_build.h )
s.files += %w( third_party/cares/config_linux/ares_config.h )
s.files += %w( third_party/cares/config_darwin/ares_config.h )
s.files += %w( third_party/cares/cares/ares__close_sockets.c )
s.files += %w( third_party/cares/cares/ares__get_hostent.c )
s.files += %w( third_party/cares/cares/ares__read_line.c )
s.files += %w( third_party/cares/cares/ares__timeval.c )
s.files += %w( third_party/cares/cares/ares_cancel.c )
s.files += %w( third_party/cares/cares/ares_create_query.c )
s.files += %w( third_party/cares/cares/ares_data.c )
s.files += %w( third_party/cares/cares/ares_destroy.c )
s.files += %w( third_party/cares/cares/ares_expand_name.c )
s.files += %w( third_party/cares/cares/ares_expand_string.c )
s.files += %w( third_party/cares/cares/ares_fds.c )
s.files += %w( third_party/cares/cares/ares_free_hostent.c )
s.files += %w( third_party/cares/cares/ares_free_string.c )
s.files += %w( third_party/cares/cares/ares_getenv.c )
s.files += %w( third_party/cares/cares/ares_gethostbyaddr.c )
s.files += %w( third_party/cares/cares/ares_gethostbyname.c )
s.files += %w( third_party/cares/cares/ares_getnameinfo.c )
s.files += %w( third_party/cares/cares/ares_getopt.c )
s.files += %w( third_party/cares/cares/ares_getsock.c )
s.files += %w( third_party/cares/cares/ares_init.c )
s.files += %w( third_party/cares/cares/ares_library_init.c )
s.files += %w( third_party/cares/cares/ares_llist.c )
s.files += %w( third_party/cares/cares/ares_mkquery.c )
s.files += %w( third_party/cares/cares/ares_nowarn.c )
s.files += %w( third_party/cares/cares/ares_options.c )
s.files += %w( third_party/cares/cares/ares_parse_a_reply.c )
s.files += %w( third_party/cares/cares/ares_parse_aaaa_reply.c )
s.files += %w( third_party/cares/cares/ares_parse_mx_reply.c )
s.files += %w( third_party/cares/cares/ares_parse_naptr_reply.c )
s.files += %w( third_party/cares/cares/ares_parse_ns_reply.c )
s.files += %w( third_party/cares/cares/ares_parse_ptr_reply.c )
s.files += %w( third_party/cares/cares/ares_parse_soa_reply.c )
s.files += %w( third_party/cares/cares/ares_parse_srv_reply.c )
s.files += %w( third_party/cares/cares/ares_parse_txt_reply.c )
s.files += %w( third_party/cares/cares/ares_platform.c )
s.files += %w( third_party/cares/cares/ares_process.c )
s.files += %w( third_party/cares/cares/ares_query.c )
s.files += %w( third_party/cares/cares/ares_search.c )
s.files += %w( third_party/cares/cares/ares_send.c )
s.files += %w( third_party/cares/cares/ares_strcasecmp.c )
s.files += %w( third_party/cares/cares/ares_strdup.c )
s.files += %w( third_party/cares/cares/ares_strerror.c )
s.files += %w( third_party/cares/cares/ares_timeout.c )
s.files += %w( third_party/cares/cares/ares_version.c )
s.files += %w( third_party/cares/cares/ares_writev.c )
s.files += %w( third_party/cares/cares/bitncmp.c )
s.files += %w( third_party/cares/cares/inet_net_pton.c )
s.files += %w( third_party/cares/cares/inet_ntop.c )
s.files += %w( third_party/cares/cares/windows_port.c )
end end

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2017, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -31,20 +31,22 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_INITIAL_CONNECT_STRING_H #ifndef GRPCXX_IMPL_CHANNEL_ARGUMENT_OPTION_H
#define GRPC_CORE_EXT_CLIENT_CHANNEL_INITIAL_CONNECT_STRING_H #define GRPCXX_IMPL_CHANNEL_ARGUMENT_OPTION_H
#include <grpc/slice.h> #include <map>
#include "src/core/lib/iomgr/resolve_address.h" #include <memory>
typedef void (*grpc_set_initial_connect_string_func)( #include <grpc++/impl/server_builder_option.h>
grpc_resolved_address **addr, grpc_slice *initial_str); #include <grpc++/support/channel_arguments.h>
void grpc_test_set_initial_connect_string_function( namespace grpc {
grpc_set_initial_connect_string_func func);
/** Set a string to be sent once connected. Optionally reset addr. */ std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
void grpc_set_initial_connect_string(grpc_resolved_address **addr, const grpc::string &name, const grpc::string &value);
grpc_slice *connect_string); std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
const grpc::string &name, int value);
#endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_INITIAL_CONNECT_STRING_H */ } // namespace grpc
#endif // GRPCXX_IMPL_CHANNEL_ARGUMENT_OPTION_H

@ -101,6 +101,39 @@ class AsyncWriterInterface {
/// \param[in] msg The message to be written. /// \param[in] msg The message to be written.
/// \param[in] tag The tag identifying the operation. /// \param[in] tag The tag identifying the operation.
virtual void Write(const W& msg, void* tag) = 0; virtual void Write(const W& msg, void* tag) = 0;
/// Request the writing of \a msg using WriteOptions \a options with
/// identifying tag \a tag.
///
/// Only one write may be outstanding at any given time. This means that
/// after calling Write, one must wait to receive \a tag from the completion
/// queue BEFORE calling Write again.
/// WriteOptions \a options is used to set the write options of this message.
/// This is thread-safe with respect to \a Read
///
/// \param[in] msg The message to be written.
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] tag The tag identifying the operation.
virtual void Write(const W& msg, WriteOptions options, void* tag) = 0;
/// Request the writing of \a msg and coalesce it with the writing
/// of trailing metadata, using WriteOptions \a options with identifying tag
/// \a tag.
///
/// For client, WriteLast is equivalent of performing Write and WritesDone in
/// a single step.
/// For server, WriteLast buffers the \a msg. The writing of \a msg is held
/// until Finish is called, where \a msg and trailing metadata are coalesced
/// and write is initiated. Note that WriteLast can only buffer \a msg up to
/// the flow control window size. If \a msg size is larger than the window
/// size, it will be sent on wire without buffering.
///
/// \param[in] msg The message to be written.
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] tag The tag identifying the operation.
void WriteLast(const W& msg, WriteOptions options, void* tag) {
Write(msg, options.set_last_message(), tag);
}
}; };
template <class R> template <class R>
@ -112,17 +145,19 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
public: public:
/// Create a stream and write the first request out. /// Create a stream and write the first request out.
template <class W> template <class W>
ClientAsyncReader(ChannelInterface* channel, CompletionQueue* cq, static ClientAsyncReader* Create(ChannelInterface* channel,
const RpcMethod& method, ClientContext* context, CompletionQueue* cq, const RpcMethod& method,
const W& request, void* tag) ClientContext* context, const W& request,
: context_(context), call_(channel->CreateCall(method, context, cq)) { void* tag) {
init_ops_.set_output_tag(tag); Call call = channel->CreateCall(method, context, cq);
init_ops_.SendInitialMetadata(context->send_initial_metadata_, return new (g_core_codegen_interface->grpc_call_arena_alloc(
context->initial_metadata_flags()); call.call(), sizeof(ClientAsyncReader)))
// TODO(ctiller): don't assert ClientAsyncReader(call, context, request, tag);
GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); }
init_ops_.ClientSendClose();
call_.PerformOps(&init_ops_); // always allocated against a call arena, no memory free required
static void operator delete(void* ptr, std::size_t size) {
assert(size == sizeof(ClientAsyncReader));
} }
void ReadInitialMetadata(void* tag) override { void ReadInitialMetadata(void* tag) override {
@ -152,6 +187,19 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> {
} }
private: private:
template <class W>
ClientAsyncReader(Call call, ClientContext* context, const W& request,
void* tag)
: context_(context), call_(call) {
init_ops_.set_output_tag(tag);
init_ops_.SendInitialMetadata(context->send_initial_metadata_,
context->initial_metadata_flags());
// TODO(ctiller): don't assert
GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok());
init_ops_.ClientSendClose();
call_.PerformOps(&init_ops_);
}
ClientContext* context_; ClientContext* context_;
Call call_; Call call_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpClientSendClose> CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpClientSendClose>
@ -177,17 +225,19 @@ template <class W>
class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
public: public:
template <class R> template <class R>
ClientAsyncWriter(ChannelInterface* channel, CompletionQueue* cq, static ClientAsyncWriter* Create(ChannelInterface* channel,
const RpcMethod& method, ClientContext* context, CompletionQueue* cq, const RpcMethod& method,
R* response, void* tag) ClientContext* context, R* response,
: context_(context), call_(channel->CreateCall(method, context, cq)) { void* tag) {
finish_ops_.RecvMessage(response); Call call = channel->CreateCall(method, context, cq);
finish_ops_.AllowNoMessage(); return new (g_core_codegen_interface->grpc_call_arena_alloc(
call.call(), sizeof(ClientAsyncWriter)))
ClientAsyncWriter(call, context, response, tag);
}
init_ops_.set_output_tag(tag); // always allocated against a call arena, no memory free required
init_ops_.SendInitialMetadata(context->send_initial_metadata_, static void operator delete(void* ptr, std::size_t size) {
context->initial_metadata_flags()); assert(size == sizeof(ClientAsyncWriter));
call_.PerformOps(&init_ops_);
} }
void ReadInitialMetadata(void* tag) override { void ReadInitialMetadata(void* tag) override {
@ -205,10 +255,21 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
call_.PerformOps(&write_ops_); call_.PerformOps(&write_ops_);
} }
void Write(const W& msg, WriteOptions options, void* tag) override {
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
write_ops_.ClientSendClose();
}
// TODO(ctiller): don't assert
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
call_.PerformOps(&write_ops_);
}
void WritesDone(void* tag) override { void WritesDone(void* tag) override {
writes_done_ops_.set_output_tag(tag); write_ops_.set_output_tag(tag);
writes_done_ops_.ClientSendClose(); write_ops_.ClientSendClose();
call_.PerformOps(&writes_done_ops_); call_.PerformOps(&write_ops_);
} }
void Finish(Status* status, void* tag) override { void Finish(Status* status, void* tag) override {
@ -221,12 +282,29 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> {
} }
private: private:
template <class R>
ClientAsyncWriter(Call call, ClientContext* context, R* response, void* tag)
: context_(context), call_(call) {
finish_ops_.RecvMessage(response);
finish_ops_.AllowNoMessage();
// if corked bit is set in context, we buffer up the initial metadata to
// coalesce with later message to be sent. No op is performed.
if (context_->initial_metadata_corked_) {
write_ops_.SendInitialMetadata(context->send_initial_metadata_,
context->initial_metadata_flags());
} else {
write_ops_.set_output_tag(tag);
write_ops_.SendInitialMetadata(context->send_initial_metadata_,
context->initial_metadata_flags());
call_.PerformOps(&write_ops_);
}
}
ClientContext* context_; ClientContext* context_;
Call call_; Call call_;
CallOpSet<CallOpSendInitialMetadata> init_ops_;
CallOpSet<CallOpRecvInitialMetadata> meta_ops_; CallOpSet<CallOpRecvInitialMetadata> meta_ops_;
CallOpSet<CallOpSendMessage> write_ops_; CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpClientSendClose>
CallOpSet<CallOpClientSendClose> writes_done_ops_; write_ops_;
CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage, CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
CallOpClientRecvStatus> CallOpClientRecvStatus>
finish_ops_; finish_ops_;
@ -249,14 +327,20 @@ template <class W, class R>
class ClientAsyncReaderWriter final class ClientAsyncReaderWriter final
: public ClientAsyncReaderWriterInterface<W, R> { : public ClientAsyncReaderWriterInterface<W, R> {
public: public:
ClientAsyncReaderWriter(ChannelInterface* channel, CompletionQueue* cq, static ClientAsyncReaderWriter* Create(ChannelInterface* channel,
const RpcMethod& method, ClientContext* context, CompletionQueue* cq,
void* tag) const RpcMethod& method,
: context_(context), call_(channel->CreateCall(method, context, cq)) { ClientContext* context, void* tag) {
init_ops_.set_output_tag(tag); Call call = channel->CreateCall(method, context, cq);
init_ops_.SendInitialMetadata(context->send_initial_metadata_,
context->initial_metadata_flags()); return new (g_core_codegen_interface->grpc_call_arena_alloc(
call_.PerformOps(&init_ops_); call.call(), sizeof(ClientAsyncReaderWriter)))
ClientAsyncReaderWriter(call, context, tag);
}
// always allocated against a call arena, no memory free required
static void operator delete(void* ptr, std::size_t size) {
assert(size == sizeof(ClientAsyncReaderWriter));
} }
void ReadInitialMetadata(void* tag) override { void ReadInitialMetadata(void* tag) override {
@ -283,10 +367,21 @@ class ClientAsyncReaderWriter final
call_.PerformOps(&write_ops_); call_.PerformOps(&write_ops_);
} }
void Write(const W& msg, WriteOptions options, void* tag) override {
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
write_ops_.ClientSendClose();
}
// TODO(ctiller): don't assert
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
call_.PerformOps(&write_ops_);
}
void WritesDone(void* tag) override { void WritesDone(void* tag) override {
writes_done_ops_.set_output_tag(tag); write_ops_.set_output_tag(tag);
writes_done_ops_.ClientSendClose(); write_ops_.ClientSendClose();
call_.PerformOps(&writes_done_ops_); call_.PerformOps(&write_ops_);
} }
void Finish(Status* status, void* tag) override { void Finish(Status* status, void* tag) override {
@ -299,13 +394,27 @@ class ClientAsyncReaderWriter final
} }
private: private:
ClientAsyncReaderWriter(Call call, ClientContext* context, void* tag)
: context_(context), call_(call) {
if (context_->initial_metadata_corked_) {
// if corked bit is set in context, we buffer up the initial metadata to
// coalesce with later message to be sent. No op is performed.
write_ops_.SendInitialMetadata(context->send_initial_metadata_,
context->initial_metadata_flags());
} else {
write_ops_.set_output_tag(tag);
write_ops_.SendInitialMetadata(context->send_initial_metadata_,
context->initial_metadata_flags());
call_.PerformOps(&write_ops_);
}
}
ClientContext* context_; ClientContext* context_;
Call call_; Call call_;
CallOpSet<CallOpSendInitialMetadata> init_ops_;
CallOpSet<CallOpRecvInitialMetadata> meta_ops_; CallOpSet<CallOpRecvInitialMetadata> meta_ops_;
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> read_ops_; CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> read_ops_;
CallOpSet<CallOpSendMessage> write_ops_; CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpClientSendClose>
CallOpSet<CallOpClientSendClose> writes_done_ops_; write_ops_;
CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> finish_ops_; CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> finish_ops_;
}; };
@ -395,6 +504,20 @@ class ServerAsyncWriterInterface : public ServerAsyncStreamingInterface,
public AsyncWriterInterface<W> { public AsyncWriterInterface<W> {
public: public:
virtual void Finish(const Status& status, void* tag) = 0; virtual void Finish(const Status& status, void* tag) = 0;
/// Request the writing of \a msg and coalesce it with trailing metadata which
/// contains \a status, using WriteOptions options with identifying tag \a
/// tag.
///
/// WriteAndFinish is equivalent of performing WriteLast and Finish in a
/// single step.
///
/// \param[in] msg The message to be written.
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] status The Status that server returns to client.
/// \param[in] tag The tag identifying the operation.
virtual void WriteAndFinish(const W& msg, WriteOptions options,
const Status& status, void* tag) = 0;
}; };
template <class W> template <class W>
@ -418,29 +541,37 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
void Write(const W& msg, void* tag) override { void Write(const W& msg, void* tag) override {
write_ops_.set_output_tag(tag); write_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) { EnsureInitialMetadataSent(&write_ops_);
write_ops_.SendInitialMetadata(ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
write_ops_.set_compression_level(ctx_->compression_level());
}
ctx_->sent_initial_metadata_ = true;
}
// TODO(ctiller): don't assert // TODO(ctiller): don't assert
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok());
call_.PerformOps(&write_ops_); call_.PerformOps(&write_ops_);
} }
void Write(const W& msg, WriteOptions options, void* tag) override {
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
}
EnsureInitialMetadataSent(&write_ops_);
// TODO(ctiller): don't assert
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
call_.PerformOps(&write_ops_);
}
void WriteAndFinish(const W& msg, WriteOptions options, const Status& status,
void* tag) override {
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
options.set_buffer_hint();
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
write_ops_.ServerSendStatus(ctx_->trailing_metadata_, status);
call_.PerformOps(&write_ops_);
}
void Finish(const Status& status, void* tag) override { void Finish(const Status& status, void* tag) override {
finish_ops_.set_output_tag(tag); finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) { EnsureInitialMetadataSent(&finish_ops_);
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
finish_ops_.set_compression_level(ctx_->compression_level());
}
ctx_->sent_initial_metadata_ = true;
}
finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status);
call_.PerformOps(&finish_ops_); call_.PerformOps(&finish_ops_);
} }
@ -448,10 +579,24 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> {
private: private:
void BindCall(Call* call) override { call_ = *call; } void BindCall(Call* call) override { call_ = *call; }
template <class T>
void EnsureInitialMetadataSent(T* ops) {
if (!ctx_->sent_initial_metadata_) {
ops->SendInitialMetadata(ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
ops->set_compression_level(ctx_->compression_level());
}
ctx_->sent_initial_metadata_ = true;
}
}
Call call_; Call call_;
ServerContext* ctx_; ServerContext* ctx_;
CallOpSet<CallOpSendInitialMetadata> meta_ops_; CallOpSet<CallOpSendInitialMetadata> meta_ops_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> write_ops_; CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus>
write_ops_;
CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_; CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_;
}; };
@ -462,6 +607,20 @@ class ServerAsyncReaderWriterInterface : public ServerAsyncStreamingInterface,
public AsyncReaderInterface<R> { public AsyncReaderInterface<R> {
public: public:
virtual void Finish(const Status& status, void* tag) = 0; virtual void Finish(const Status& status, void* tag) = 0;
/// Request the writing of \a msg and coalesce it with trailing metadata which
/// contains \a status, using WriteOptions options with identifying tag \a
/// tag.
///
/// WriteAndFinish is equivalent of performing WriteLast and Finish in a
/// single step.
///
/// \param[in] msg The message to be written.
/// \param[in] options The WriteOptions to be used to write this message.
/// \param[in] status The Status that server returns to client.
/// \param[in] tag The tag identifying the operation.
virtual void WriteAndFinish(const W& msg, WriteOptions options,
const Status& status, void* tag) = 0;
}; };
template <class W, class R> template <class W, class R>
@ -492,29 +651,36 @@ class ServerAsyncReaderWriter final
void Write(const W& msg, void* tag) override { void Write(const W& msg, void* tag) override {
write_ops_.set_output_tag(tag); write_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) { EnsureInitialMetadataSent(&write_ops_);
write_ops_.SendInitialMetadata(ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
write_ops_.set_compression_level(ctx_->compression_level());
}
ctx_->sent_initial_metadata_ = true;
}
// TODO(ctiller): don't assert // TODO(ctiller): don't assert
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok());
call_.PerformOps(&write_ops_); call_.PerformOps(&write_ops_);
} }
void Write(const W& msg, WriteOptions options, void* tag) override {
write_ops_.set_output_tag(tag);
if (options.is_last_message()) {
options.set_buffer_hint();
}
EnsureInitialMetadataSent(&write_ops_);
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
call_.PerformOps(&write_ops_);
}
void WriteAndFinish(const W& msg, WriteOptions options, const Status& status,
void* tag) override {
write_ops_.set_output_tag(tag);
EnsureInitialMetadataSent(&write_ops_);
options.set_buffer_hint();
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg, options).ok());
write_ops_.ServerSendStatus(ctx_->trailing_metadata_, status);
call_.PerformOps(&write_ops_);
}
void Finish(const Status& status, void* tag) override { void Finish(const Status& status, void* tag) override {
finish_ops_.set_output_tag(tag); finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) { EnsureInitialMetadataSent(&finish_ops_);
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
finish_ops_.set_compression_level(ctx_->compression_level());
}
ctx_->sent_initial_metadata_ = true;
}
finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status);
call_.PerformOps(&finish_ops_); call_.PerformOps(&finish_ops_);
} }
@ -524,11 +690,25 @@ class ServerAsyncReaderWriter final
void BindCall(Call* call) override { call_ = *call; } void BindCall(Call* call) override { call_ = *call; }
template <class T>
void EnsureInitialMetadataSent(T* ops) {
if (!ctx_->sent_initial_metadata_) {
ops->SendInitialMetadata(ctx_->initial_metadata_,
ctx_->initial_metadata_flags());
if (ctx_->compression_level_set()) {
ops->set_compression_level(ctx_->compression_level());
}
ctx_->sent_initial_metadata_ = true;
}
}
Call call_; Call call_;
ServerContext* ctx_; ServerContext* ctx_;
CallOpSet<CallOpSendInitialMetadata> meta_ops_; CallOpSet<CallOpSendInitialMetadata> meta_ops_;
CallOpSet<CallOpRecvMessage<R>> read_ops_; CallOpSet<CallOpRecvMessage<R>> read_ops_;
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> write_ops_; CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpServerSendStatus>
write_ops_;
CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_; CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_;
}; };

@ -34,6 +34,7 @@
#ifndef GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #ifndef GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H
#define GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #define GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H
#include <assert.h>
#include <grpc++/impl/codegen/call.h> #include <grpc++/impl/codegen/call.h>
#include <grpc++/impl/codegen/channel_interface.h> #include <grpc++/impl/codegen/channel_interface.h>
#include <grpc++/impl/codegen/client_context.h> #include <grpc++/impl/codegen/client_context.h>
@ -59,57 +60,67 @@ class ClientAsyncResponseReader final
: public ClientAsyncResponseReaderInterface<R> { : public ClientAsyncResponseReaderInterface<R> {
public: public:
template <class W> template <class W>
ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq, static ClientAsyncResponseReader* Create(ChannelInterface* channel,
const RpcMethod& method, ClientContext* context, CompletionQueue* cq,
const W& request) const RpcMethod& method,
: context_(context), ClientContext* context,
call_(channel->CreateCall(method, context, cq)), const W& request) {
collection_(std::make_shared<CallOpSetCollection>()) { Call call = channel->CreateCall(method, context, cq);
collection_->init_buf_.SetCollection(collection_); return new (g_core_codegen_interface->grpc_call_arena_alloc(
collection_->init_buf_.SendInitialMetadata( call.call(), sizeof(ClientAsyncResponseReader)))
context->send_initial_metadata_, context->initial_metadata_flags()); ClientAsyncResponseReader(call, context, request);
// TODO(ctiller): don't assert }
GPR_CODEGEN_ASSERT(collection_->init_buf_.SendMessage(request).ok());
collection_->init_buf_.ClientSendClose(); // always allocated against a call arena, no memory free required
call_.PerformOps(&collection_->init_buf_); static void operator delete(void* ptr, std::size_t size) {
assert(size == sizeof(ClientAsyncResponseReader));
} }
void ReadInitialMetadata(void* tag) { void ReadInitialMetadata(void* tag) {
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_);
collection_->meta_buf_.SetCollection(collection_); meta_buf_.set_output_tag(tag);
collection_->meta_buf_.set_output_tag(tag); meta_buf_.RecvInitialMetadata(context_);
collection_->meta_buf_.RecvInitialMetadata(context_); call_.PerformOps(&meta_buf_);
call_.PerformOps(&collection_->meta_buf_);
} }
void Finish(R* msg, Status* status, void* tag) { void Finish(R* msg, Status* status, void* tag) {
collection_->finish_buf_.SetCollection(collection_); finish_buf_.set_output_tag(tag);
collection_->finish_buf_.set_output_tag(tag);
if (!context_->initial_metadata_received_) { if (!context_->initial_metadata_received_) {
collection_->finish_buf_.RecvInitialMetadata(context_); finish_buf_.RecvInitialMetadata(context_);
} }
collection_->finish_buf_.RecvMessage(msg); finish_buf_.RecvMessage(msg);
collection_->finish_buf_.AllowNoMessage(); finish_buf_.AllowNoMessage();
collection_->finish_buf_.ClientRecvStatus(context_, status); finish_buf_.ClientRecvStatus(context_, status);
call_.PerformOps(&collection_->finish_buf_); call_.PerformOps(&finish_buf_);
} }
private: private:
ClientContext* context_; ClientContext* const context_;
Call call_; Call call_;
class CallOpSetCollection : public CallOpSetCollectionInterface { template <class W>
public: ClientAsyncResponseReader(Call call, ClientContext* context, const W& request)
SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, : context_(context), call_(call) {
CallOpClientSendClose> init_buf_.SendInitialMetadata(context->send_initial_metadata_,
init_buf_; context->initial_metadata_flags());
CallOpSet<CallOpRecvInitialMetadata> meta_buf_; // TODO(ctiller): don't assert
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>, GPR_CODEGEN_ASSERT(init_buf_.SendMessage(request).ok());
CallOpClientRecvStatus> init_buf_.ClientSendClose();
finish_buf_; call_.PerformOps(&init_buf_);
}; }
std::shared_ptr<CallOpSetCollection> collection_;
// disable operator new
static void* operator new(std::size_t size);
static void* operator new(std::size_t size, void* p) { return p; };
SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose>
init_buf_;
CallOpSet<CallOpRecvInitialMetadata> meta_buf_;
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>,
CallOpClientRecvStatus>
finish_buf_;
}; };
template <class W> template <class W>
@ -179,4 +190,12 @@ class ServerAsyncResponseWriter final : public ServerAsyncStreamingInterface {
} // namespace grpc } // namespace grpc
namespace std {
template <class R>
class default_delete<grpc::ClientAsyncResponseReader<R>> {
public:
void operator()(void* p) {}
};
}
#endif // GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #endif // GRPCXX_IMPL_CODEGEN_ASYNC_UNARY_CALL_H

@ -34,6 +34,7 @@
#ifndef GRPCXX_IMPL_CODEGEN_CALL_H #ifndef GRPCXX_IMPL_CODEGEN_CALL_H
#define GRPCXX_IMPL_CODEGEN_CALL_H #define GRPCXX_IMPL_CODEGEN_CALL_H
#include <assert.h>
#include <cstring> #include <cstring>
#include <functional> #include <functional>
#include <map> #include <map>
@ -47,9 +48,9 @@
#include <grpc++/impl/codegen/serialization_traits.h> #include <grpc++/impl/codegen/serialization_traits.h>
#include <grpc++/impl/codegen/slice.h> #include <grpc++/impl/codegen/slice.h>
#include <grpc++/impl/codegen/status.h> #include <grpc++/impl/codegen/status.h>
#include <grpc++/impl/codegen/status_helper.h>
#include <grpc++/impl/codegen/string_ref.h> #include <grpc++/impl/codegen/string_ref.h>
#include <grpc/impl/codegen/atm.h>
#include <grpc/impl/codegen/compression_types.h> #include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/grpc_types.h> #include <grpc/impl/codegen/grpc_types.h>
@ -63,29 +64,40 @@ class CallHook;
class CompletionQueue; class CompletionQueue;
extern CoreCodegenInterface* g_core_codegen_interface; extern CoreCodegenInterface* g_core_codegen_interface;
const char kBinaryErrorDetailsKey[] = "grpc-status-details-bin";
// TODO(yangg) if the map is changed before we send, the pointers will be a // TODO(yangg) if the map is changed before we send, the pointers will be a
// mess. Make sure it does not happen. // mess. Make sure it does not happen.
inline grpc_metadata* FillMetadataArray( inline grpc_metadata* FillMetadataArray(
const std::multimap<grpc::string, grpc::string>& metadata) { const std::multimap<grpc::string, grpc::string>& metadata,
if (metadata.empty()) { size_t* metadata_count, const grpc::string& optional_error_details) {
*metadata_count = metadata.size() + (optional_error_details.empty() ? 0 : 1);
if (*metadata_count == 0) {
return nullptr; return nullptr;
} }
grpc_metadata* metadata_array = grpc_metadata* metadata_array =
(grpc_metadata*)(g_core_codegen_interface->gpr_malloc( (grpc_metadata*)(g_core_codegen_interface->gpr_malloc(
metadata.size() * sizeof(grpc_metadata))); (*metadata_count) * sizeof(grpc_metadata)));
size_t i = 0; size_t i = 0;
for (auto iter = metadata.cbegin(); iter != metadata.cend(); ++iter, ++i) { for (auto iter = metadata.cbegin(); iter != metadata.cend(); ++iter, ++i) {
metadata_array[i].key = SliceReferencingString(iter->first); metadata_array[i].key = SliceReferencingString(iter->first);
metadata_array[i].value = SliceReferencingString(iter->second); metadata_array[i].value = SliceReferencingString(iter->second);
} }
if (!optional_error_details.empty()) {
metadata_array[i].key =
g_core_codegen_interface->grpc_slice_from_static_buffer(
kBinaryErrorDetailsKey, sizeof(kBinaryErrorDetailsKey) - 1);
metadata_array[i].value = SliceReferencingString(optional_error_details);
}
return metadata_array; return metadata_array;
} }
/// Per-message write options. /// Per-message write options.
class WriteOptions { class WriteOptions {
public: public:
WriteOptions() : flags_(0) {} WriteOptions() : flags_(0), last_message_(false) {}
WriteOptions(const WriteOptions& other) : flags_(other.flags_) {} WriteOptions(const WriteOptions& other)
: flags_(other.flags_), last_message_(other.last_message_) {}
/// Clear all flags. /// Clear all flags.
inline void Clear() { flags_ = 0; } inline void Clear() { flags_ = 0; }
@ -141,6 +153,43 @@ class WriteOptions {
/// \sa GRPC_WRITE_BUFFER_HINT /// \sa GRPC_WRITE_BUFFER_HINT
inline bool get_buffer_hint() const { return GetBit(GRPC_WRITE_BUFFER_HINT); } inline bool get_buffer_hint() const { return GetBit(GRPC_WRITE_BUFFER_HINT); }
/// corked bit: aliases set_buffer_hint currently, with the intent that
/// set_buffer_hint will be removed in the future
inline WriteOptions& set_corked() {
SetBit(GRPC_WRITE_BUFFER_HINT);
return *this;
}
inline WriteOptions& clear_corked() {
ClearBit(GRPC_WRITE_BUFFER_HINT);
return *this;
}
inline bool is_corked() const { return GetBit(GRPC_WRITE_BUFFER_HINT); }
/// last-message bit: indicates this is the last message in a stream
/// client-side: makes Write the equivalent of performing Write, WritesDone
/// in a single step
/// server-side: hold the Write until the service handler returns (sync api)
/// or until Finish is called (async api)
inline WriteOptions& set_last_message() {
last_message_ = true;
return *this;
}
/// Clears flag indicating that this is the last message in a stream,
/// disabling coalescing.
inline WriteOptions& clear_last_messsage() {
last_message_ = false;
return *this;
}
/// Get value for the flag indicating that this is the last message, and
/// should be coalesced with trailing metadata.
///
/// \sa GRPC_WRITE_LAST_MESSAGE
bool is_last_message() const { return last_message_; }
WriteOptions& operator=(const WriteOptions& rhs) { WriteOptions& operator=(const WriteOptions& rhs) {
flags_ = rhs.flags_; flags_ = rhs.flags_;
return *this; return *this;
@ -154,6 +203,7 @@ class WriteOptions {
bool GetBit(const uint32_t mask) const { return (flags_ & mask) != 0; } bool GetBit(const uint32_t mask) const { return (flags_ & mask) != 0; }
uint32_t flags_; uint32_t flags_;
bool last_message_;
}; };
/// Default argument for CallOpSet. I is unused by the class, but can be /// Default argument for CallOpSet. I is unused by the class, but can be
@ -177,8 +227,8 @@ class CallOpSendInitialMetadata {
maybe_compression_level_.is_set = false; maybe_compression_level_.is_set = false;
send_ = true; send_ = true;
flags_ = flags; flags_ = flags;
initial_metadata_count_ = metadata.size(); initial_metadata_ =
initial_metadata_ = FillMetadataArray(metadata); FillMetadataArray(metadata, &initial_metadata_count_, "");
} }
void set_compression_level(grpc_compression_level level) { void set_compression_level(grpc_compression_level level) {
@ -197,8 +247,10 @@ class CallOpSendInitialMetadata {
op->data.send_initial_metadata.metadata = initial_metadata_; op->data.send_initial_metadata.metadata = initial_metadata_;
op->data.send_initial_metadata.maybe_compression_level.is_set = op->data.send_initial_metadata.maybe_compression_level.is_set =
maybe_compression_level_.is_set; maybe_compression_level_.is_set;
op->data.send_initial_metadata.maybe_compression_level.level = if (maybe_compression_level_.is_set) {
maybe_compression_level_.level; op->data.send_initial_metadata.maybe_compression_level.level =
maybe_compression_level_.level;
}
} }
void FinishOp(bool* status) { void FinishOp(bool* status) {
if (!send_) return; if (!send_) return;
@ -224,7 +276,7 @@ class CallOpSendMessage {
/// after use. /// after use.
template <class M> template <class M>
Status SendMessage(const M& message, Status SendMessage(const M& message,
const WriteOptions& options) GRPC_MUST_USE_RESULT; WriteOptions options) GRPC_MUST_USE_RESULT;
template <class M> template <class M>
Status SendMessage(const M& message) GRPC_MUST_USE_RESULT; Status SendMessage(const M& message) GRPC_MUST_USE_RESULT;
@ -252,8 +304,7 @@ class CallOpSendMessage {
}; };
template <class M> template <class M>
Status CallOpSendMessage::SendMessage(const M& message, Status CallOpSendMessage::SendMessage(const M& message, WriteOptions options) {
const WriteOptions& options) {
write_options_ = options; write_options_ = options;
return SerializationTraits<M>::Serialize(message, &send_buf_, &own_buf_); return SerializationTraits<M>::Serialize(message, &send_buf_, &own_buf_);
} }
@ -313,28 +364,6 @@ class CallOpRecvMessage {
bool allow_not_getting_message_; bool allow_not_getting_message_;
}; };
namespace CallOpGenericRecvMessageHelper {
class DeserializeFunc {
public:
virtual Status Deserialize(grpc_byte_buffer* buf) = 0;
virtual ~DeserializeFunc() {}
};
template <class R>
class DeserializeFuncType final : public DeserializeFunc {
public:
DeserializeFuncType(R* message) : message_(message) {}
Status Deserialize(grpc_byte_buffer* buf) override {
return SerializationTraits<R>::Deserialize(buf, message_);
}
~DeserializeFuncType() override {}
private:
R* message_; // Not a managed pointer because management is external to this
};
} // namespace CallOpGenericRecvMessageHelper
class CallOpGenericRecvMessage { class CallOpGenericRecvMessage {
public: public:
CallOpGenericRecvMessage() CallOpGenericRecvMessage()
@ -342,11 +371,9 @@ class CallOpGenericRecvMessage {
template <class R> template <class R>
void RecvMessage(R* message) { void RecvMessage(R* message) {
// Use an explicit base class pointer to avoid resolution error in the deserialize_ = [message](grpc_byte_buffer* buf) -> Status {
// following unique_ptr::reset for some old implementations. return SerializationTraits<R>::Deserialize(buf, message);
CallOpGenericRecvMessageHelper::DeserializeFunc* func = };
new CallOpGenericRecvMessageHelper::DeserializeFuncType<R>(message);
deserialize_.reset(func);
} }
// Do not change status if no message is received. // Do not change status if no message is received.
@ -369,7 +396,7 @@ class CallOpGenericRecvMessage {
if (recv_buf_) { if (recv_buf_) {
if (*status) { if (*status) {
got_message = true; got_message = true;
*status = deserialize_->Deserialize(recv_buf_).ok(); *status = deserialize_(recv_buf_).ok();
} else { } else {
got_message = false; got_message = false;
g_core_codegen_interface->grpc_byte_buffer_destroy(recv_buf_); g_core_codegen_interface->grpc_byte_buffer_destroy(recv_buf_);
@ -380,11 +407,12 @@ class CallOpGenericRecvMessage {
*status = false; *status = false;
} }
} }
deserialize_.reset(); deserialize_ = DeserializeFunc();
} }
private: private:
std::unique_ptr<CallOpGenericRecvMessageHelper::DeserializeFunc> deserialize_; typedef std::function<Status(grpc_byte_buffer*)> DeserializeFunc;
DeserializeFunc deserialize_;
grpc_byte_buffer* recv_buf_; grpc_byte_buffer* recv_buf_;
bool allow_not_getting_message_; bool allow_not_getting_message_;
}; };
@ -416,11 +444,12 @@ class CallOpServerSendStatus {
void ServerSendStatus( void ServerSendStatus(
const std::multimap<grpc::string, grpc::string>& trailing_metadata, const std::multimap<grpc::string, grpc::string>& trailing_metadata,
const Status& status) { const Status& status) {
trailing_metadata_count_ = trailing_metadata.size(); send_error_details_ = status.error_details();
trailing_metadata_ = FillMetadataArray(trailing_metadata); trailing_metadata_ = FillMetadataArray(
trailing_metadata, &trailing_metadata_count_, send_error_details_);
send_status_available_ = true; send_status_available_ = true;
send_status_code_ = static_cast<grpc_status_code>(GetCanonicalCode(status)); send_status_code_ = static_cast<grpc_status_code>(status.error_code());
send_status_details_ = status.error_message(); send_error_message_ = status.error_message();
} }
protected: protected:
@ -432,9 +461,9 @@ class CallOpServerSendStatus {
trailing_metadata_count_; trailing_metadata_count_;
op->data.send_status_from_server.trailing_metadata = trailing_metadata_; op->data.send_status_from_server.trailing_metadata = trailing_metadata_;
op->data.send_status_from_server.status = send_status_code_; op->data.send_status_from_server.status = send_status_code_;
status_details_slice_ = SliceReferencingString(send_status_details_); error_message_slice_ = SliceReferencingString(send_error_message_);
op->data.send_status_from_server.status_details = op->data.send_status_from_server.status_details =
send_status_details_.empty() ? nullptr : &status_details_slice_; send_error_message_.empty() ? nullptr : &error_message_slice_;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
} }
@ -448,10 +477,11 @@ class CallOpServerSendStatus {
private: private:
bool send_status_available_; bool send_status_available_;
grpc_status_code send_status_code_; grpc_status_code send_status_code_;
grpc::string send_status_details_; grpc::string send_error_details_;
grpc::string send_error_message_;
size_t trailing_metadata_count_; size_t trailing_metadata_count_;
grpc_metadata* trailing_metadata_; grpc_metadata* trailing_metadata_;
grpc_slice status_details_slice_; grpc_slice error_message_slice_;
}; };
class CallOpRecvInitialMetadata { class CallOpRecvInitialMetadata {
@ -490,6 +520,7 @@ class CallOpClientRecvStatus {
void ClientRecvStatus(ClientContext* context, Status* status) { void ClientRecvStatus(ClientContext* context, Status* status) {
metadata_map_ = &context->trailing_metadata_; metadata_map_ = &context->trailing_metadata_;
recv_status_ = status; recv_status_ = status;
error_message_ = g_core_codegen_interface->grpc_empty_slice();
} }
protected: protected:
@ -499,7 +530,7 @@ class CallOpClientRecvStatus {
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
op->data.recv_status_on_client.trailing_metadata = metadata_map_->arr(); op->data.recv_status_on_client.trailing_metadata = metadata_map_->arr();
op->data.recv_status_on_client.status = &status_code_; op->data.recv_status_on_client.status = &status_code_;
op->data.recv_status_on_client.status_details = &status_details_; op->data.recv_status_on_client.status_details = &error_message_;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
} }
@ -507,10 +538,17 @@ class CallOpClientRecvStatus {
void FinishOp(bool* status) { void FinishOp(bool* status) {
if (recv_status_ == nullptr) return; if (recv_status_ == nullptr) return;
metadata_map_->FillMap(); metadata_map_->FillMap();
grpc::string binary_error_details;
auto iter = metadata_map_->map()->find(kBinaryErrorDetailsKey);
if (iter != metadata_map_->map()->end()) {
binary_error_details =
grpc::string(iter->second.begin(), iter->second.length());
}
*recv_status_ = Status(static_cast<StatusCode>(status_code_), *recv_status_ = Status(static_cast<StatusCode>(status_code_),
grpc::string(GRPC_SLICE_START_PTR(status_details_), grpc::string(GRPC_SLICE_START_PTR(error_message_),
GRPC_SLICE_END_PTR(status_details_))); GRPC_SLICE_END_PTR(error_message_)),
g_core_codegen_interface->grpc_slice_unref(status_details_); binary_error_details);
g_core_codegen_interface->grpc_slice_unref(error_message_);
recv_status_ = nullptr; recv_status_ = nullptr;
} }
@ -518,20 +556,9 @@ class CallOpClientRecvStatus {
MetadataMap* metadata_map_; MetadataMap* metadata_map_;
Status* recv_status_; Status* recv_status_;
grpc_status_code status_code_; grpc_status_code status_code_;
grpc_slice status_details_; grpc_slice error_message_;
}; };
/// An abstract collection of CallOpSet's, to be used whenever
/// CallOpSet objects must be thought of as a group. Each member
/// of the group should have a shared_ptr back to the collection,
/// as will the object that instantiates the collection, allowing
/// for automatic ref-counting. In practice, any actual use should
/// derive from this base class. This is specifically necessary if
/// some of the CallOpSet's in the collection are "Sneaky" and don't
/// report back to the C++ layer CQ operations
class CallOpSetCollectionInterface
: public std::enable_shared_from_this<CallOpSetCollectionInterface> {};
/// An abstract collection of call ops, used to generate the /// An abstract collection of call ops, used to generate the
/// grpc_call_op structure to pass down to the lower layers, /// grpc_call_op structure to pass down to the lower layers,
/// and as it is-a CompletionQueueTag, also massages the final /// and as it is-a CompletionQueueTag, also massages the final
@ -539,18 +566,9 @@ class CallOpSetCollectionInterface
/// API. /// API.
class CallOpSetInterface : public CompletionQueueTag { class CallOpSetInterface : public CompletionQueueTag {
public: public:
CallOpSetInterface() {}
/// Fills in grpc_op, starting from ops[*nops] and moving /// Fills in grpc_op, starting from ops[*nops] and moving
/// upwards. /// upwards.
virtual void FillOps(grpc_op* ops, size_t* nops) = 0; virtual void FillOps(grpc_call* call, grpc_op* ops, size_t* nops) = 0;
/// Mark this as belonging to a collection if needed
void SetCollection(std::shared_ptr<CallOpSetCollectionInterface> collection) {
collection_ = collection;
}
protected:
std::shared_ptr<CallOpSetCollectionInterface> collection_;
}; };
/// Primary implementaiton of CallOpSetInterface. /// Primary implementaiton of CallOpSetInterface.
@ -571,13 +589,15 @@ class CallOpSet : public CallOpSetInterface,
public Op6 { public Op6 {
public: public:
CallOpSet() : return_tag_(this) {} CallOpSet() : return_tag_(this) {}
void FillOps(grpc_op* ops, size_t* nops) override { void FillOps(grpc_call* call, grpc_op* ops, size_t* nops) override {
this->Op1::AddOp(ops, nops); this->Op1::AddOp(ops, nops);
this->Op2::AddOp(ops, nops); this->Op2::AddOp(ops, nops);
this->Op3::AddOp(ops, nops); this->Op3::AddOp(ops, nops);
this->Op4::AddOp(ops, nops); this->Op4::AddOp(ops, nops);
this->Op5::AddOp(ops, nops); this->Op5::AddOp(ops, nops);
this->Op6::AddOp(ops, nops); this->Op6::AddOp(ops, nops);
g_core_codegen_interface->grpc_call_ref(call);
call_ = call;
} }
bool FinalizeResult(void** tag, bool* status) override { bool FinalizeResult(void** tag, bool* status) override {
@ -588,7 +608,7 @@ class CallOpSet : public CallOpSetInterface,
this->Op5::FinishOp(status); this->Op5::FinishOp(status);
this->Op6::FinishOp(status); this->Op6::FinishOp(status);
*tag = return_tag_; *tag = return_tag_;
collection_.reset(); // drop the ref at this point g_core_codegen_interface->grpc_call_unref(call_);
return true; return true;
} }
@ -596,6 +616,7 @@ class CallOpSet : public CallOpSetInterface,
private: private:
void* return_tag_; void* return_tag_;
grpc_call* call_;
}; };
/// A CallOpSet that does not post completions to the completion queue. /// A CallOpSet that does not post completions to the completion queue.

@ -281,6 +281,17 @@ class ClientContext {
/// \param algorithm The compression algorithm used for the client call. /// \param algorithm The compression algorithm used for the client call.
void set_compression_algorithm(grpc_compression_algorithm algorithm); void set_compression_algorithm(grpc_compression_algorithm algorithm);
/// Flag whether the initial metadata should be \a corked
///
/// If \a corked is true, then the initial metadata will be colasced with the
/// write of first message in the stream.
///
/// \param corked The flag indicating whether the initial metadata is to be
/// corked or not.
void set_initial_metadata_corked(bool corked) {
initial_metadata_corked_ = corked;
}
/// Return the peer uri in a string. /// Return the peer uri in a string.
/// ///
/// \warning This value is never authenticated or subject to any security /// \warning This value is never authenticated or subject to any security
@ -357,7 +368,8 @@ class ClientContext {
(cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0) | (cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0) |
(wait_for_ready_explicitly_set_ (wait_for_ready_explicitly_set_
? GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET ? GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET
: 0); : 0) |
(initial_metadata_corked_ ? GRPC_INITIAL_METADATA_CORKED : 0);
} }
grpc::string authority() { return authority_; } grpc::string authority() { return authority_; }
@ -384,6 +396,7 @@ class ClientContext {
PropagationOptions propagation_options_; PropagationOptions propagation_options_;
grpc_compression_algorithm compression_algorithm_; grpc_compression_algorithm compression_algorithm_;
bool initial_metadata_corked_;
}; };
} // namespace grpc } // namespace grpc

@ -52,7 +52,9 @@ template <class InputMessage, class OutputMessage>
Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, const InputMessage& request, ClientContext* context, const InputMessage& request,
OutputMessage* result) { OutputMessage* result) {
CompletionQueue cq; CompletionQueue cq(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
GRPC_CQ_DEFAULT_POLLING}); // Pluckable completion queue
Call call(channel->CreateCall(method, context, &cq)); Call call(channel->CreateCall(method, context, &cq));
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>, CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,

@ -102,10 +102,9 @@ class CompletionQueue : private GrpcLibraryCodegen {
public: public:
/// Default constructor. Implicitly creates a \a grpc_completion_queue /// Default constructor. Implicitly creates a \a grpc_completion_queue
/// instance. /// instance.
CompletionQueue() { CompletionQueue()
cq_ = g_core_codegen_interface->grpc_completion_queue_create(nullptr); : CompletionQueue(grpc_completion_queue_attributes{
InitialAvalanching(); // reserve this for the future shutdown GRPC_CQ_CURRENT_VERSION, GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING}) {}
}
/// Wrap \a take, taking ownership of the instance. /// Wrap \a take, taking ownership of the instance.
/// ///
@ -185,6 +184,16 @@ class CompletionQueue : private GrpcLibraryCodegen {
}; };
void CompleteAvalanching(); void CompleteAvalanching();
protected:
/// Private constructor of CompletionQueue only visible to friend classes
CompletionQueue(const grpc_completion_queue_attributes& attributes) {
cq_ = g_core_codegen_interface->grpc_completion_queue_create(
g_core_codegen_interface->grpc_completion_queue_factory_lookup(
&attributes),
&attributes, NULL);
InitialAvalanching(); // reserve this for the future shutdown
}
private: private:
// Friend synchronous wrappers so that they can access Pluck(), which is // Friend synchronous wrappers so that they can access Pluck(), which is
// a semi-private API geared towards the synchronous implementation. // a semi-private API geared towards the synchronous implementation.
@ -237,6 +246,12 @@ class CompletionQueue : private GrpcLibraryCodegen {
/// Performs a single polling pluck on \a tag. /// Performs a single polling pluck on \a tag.
/// \warning Must not be mixed with calls to \a Next. /// \warning Must not be mixed with calls to \a Next.
///
/// TODO: sreek - This calls tag->FinalizeResult() even if the cq_ is already
/// shutdown. This is most likely a bug and if it is a bug, then change this
/// implementation to simple call the other TryPluck function with a zero
/// timeout. i.e:
/// TryPluck(tag, gpr_time_0(GPR_CLOCK_REALTIME))
void TryPluck(CompletionQueueTag* tag) { void TryPluck(CompletionQueueTag* tag) {
auto deadline = g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME); auto deadline = g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME);
auto ev = g_core_codegen_interface->grpc_completion_queue_pluck( auto ev = g_core_codegen_interface->grpc_completion_queue_pluck(
@ -248,6 +263,23 @@ class CompletionQueue : private GrpcLibraryCodegen {
GPR_CODEGEN_ASSERT(!tag->FinalizeResult(&ignored, &ok)); GPR_CODEGEN_ASSERT(!tag->FinalizeResult(&ignored, &ok));
} }
/// Performs a single polling pluck on \a tag. Calls tag->FinalizeResult if
/// the pluck() was successful and returned the tag.
///
/// This exects tag->FinalizeResult (if called) to return 'false' i.e expects
/// that the tag is internal not something that is returned to the user.
void TryPluck(CompletionQueueTag* tag, gpr_timespec deadline) {
auto ev = g_core_codegen_interface->grpc_completion_queue_pluck(
cq_, tag, deadline, nullptr);
if (ev.type == GRPC_QUEUE_TIMEOUT || ev.type == GRPC_QUEUE_SHUTDOWN) {
return;
}
bool ok = ev.success != 0;
void* ignored = tag;
GPR_CODEGEN_ASSERT(!tag->FinalizeResult(&ignored, &ok));
}
grpc_completion_queue* cq_; // owned grpc_completion_queue* cq_; // owned
gpr_atm avalanches_in_flight_; gpr_atm avalanches_in_flight_;
@ -257,17 +289,19 @@ class CompletionQueue : private GrpcLibraryCodegen {
/// by servers. Instantiated by \a ServerBuilder. /// by servers. Instantiated by \a ServerBuilder.
class ServerCompletionQueue : public CompletionQueue { class ServerCompletionQueue : public CompletionQueue {
public: public:
bool IsFrequentlyPolled() { return is_frequently_polled_; } bool IsFrequentlyPolled() { return polling_type_ != GRPC_CQ_NON_LISTENING; }
private: private:
bool is_frequently_polled_; grpc_cq_polling_type polling_type_;
friend class ServerBuilder; friend class ServerBuilder;
/// \param is_frequently_polled Informs the GRPC library about whether the /// \param is_frequently_polled Informs the GRPC library about whether the
/// server completion queue would be actively polled (by calling Next() or /// server completion queue would be actively polled (by calling Next() or
/// AsyncNext()). By default all server completion queues are assumed to be /// AsyncNext()). By default all server completion queues are assumed to be
/// frequently polled. /// frequently polled.
ServerCompletionQueue(bool is_frequently_polled = true) ServerCompletionQueue(grpc_cq_polling_type polling_type)
: is_frequently_polled_(is_frequently_polled) {} : CompletionQueue(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_NEXT, polling_type}),
polling_type_(polling_type) {}
}; };
} // namespace grpc } // namespace grpc

@ -38,14 +38,25 @@
#include <grpc++/impl/codegen/core_codegen_interface.h> #include <grpc++/impl/codegen/core_codegen_interface.h>
#include <grpc/byte_buffer.h> #include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h> #include <grpc/impl/codegen/grpc_types.h>
namespace grpc { namespace grpc {
/// Implementation of the core codegen interface. /// Implementation of the core codegen interface.
class CoreCodegen : public CoreCodegenInterface { class CoreCodegen final : public CoreCodegenInterface {
private: private:
grpc_completion_queue* grpc_completion_queue_create(void* reserved) override; virtual const grpc_completion_queue_factory*
grpc_completion_queue_factory_lookup(
const grpc_completion_queue_attributes* attributes) override;
virtual grpc_completion_queue* grpc_completion_queue_create(
const grpc_completion_queue_factory* factory,
const grpc_completion_queue_attributes* attributes,
void* reserved) override;
grpc_completion_queue* grpc_completion_queue_create_for_next(
void* reserved) override;
grpc_completion_queue* grpc_completion_queue_create_for_pluck(
void* reserved) override;
void grpc_completion_queue_destroy(grpc_completion_queue* cq) override; void grpc_completion_queue_destroy(grpc_completion_queue* cq) override;
grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, void* tag, grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, void* tag,
gpr_timespec deadline, gpr_timespec deadline,
@ -64,6 +75,10 @@ class CoreCodegen : public CoreCodegenInterface {
void gpr_cv_signal(gpr_cv* cv) override; void gpr_cv_signal(gpr_cv* cv) override;
void gpr_cv_broadcast(gpr_cv* cv) override; void gpr_cv_broadcast(gpr_cv* cv) override;
void grpc_call_ref(grpc_call* call) override;
void grpc_call_unref(grpc_call* call) override;
virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) override;
void grpc_byte_buffer_destroy(grpc_byte_buffer* bb) override; void grpc_byte_buffer_destroy(grpc_byte_buffer* bb) override;
int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader, int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
@ -76,6 +91,7 @@ class CoreCodegen : public CoreCodegenInterface {
grpc_byte_buffer* grpc_raw_byte_buffer_create(grpc_slice* slice, grpc_byte_buffer* grpc_raw_byte_buffer_create(grpc_slice* slice,
size_t nslices) override; size_t nslices) override;
grpc_slice grpc_empty_slice() override;
grpc_slice grpc_slice_malloc(size_t length) override; grpc_slice grpc_slice_malloc(size_t length) override;
void grpc_slice_unref(grpc_slice slice) override; void grpc_slice_unref(grpc_slice slice) override;
grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) override; grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) override;

@ -59,7 +59,15 @@ class CoreCodegenInterface {
virtual void assert_fail(const char* failed_assertion, const char* file, virtual void assert_fail(const char* failed_assertion, const char* file,
int line) = 0; int line) = 0;
virtual const grpc_completion_queue_factory*
grpc_completion_queue_factory_lookup(
const grpc_completion_queue_attributes* attributes) = 0;
virtual grpc_completion_queue* grpc_completion_queue_create( virtual grpc_completion_queue* grpc_completion_queue_create(
const grpc_completion_queue_factory* factory,
const grpc_completion_queue_attributes* attributes, void* reserved) = 0;
virtual grpc_completion_queue* grpc_completion_queue_create_for_next(
void* reserved) = 0;
virtual grpc_completion_queue* grpc_completion_queue_create_for_pluck(
void* reserved) = 0; void* reserved) = 0;
virtual void grpc_completion_queue_destroy(grpc_completion_queue* cq) = 0; virtual void grpc_completion_queue_destroy(grpc_completion_queue* cq) = 0;
virtual grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, virtual grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq,
@ -94,6 +102,11 @@ class CoreCodegenInterface {
virtual grpc_byte_buffer* grpc_raw_byte_buffer_create(grpc_slice* slice, virtual grpc_byte_buffer* grpc_raw_byte_buffer_create(grpc_slice* slice,
size_t nslices) = 0; size_t nslices) = 0;
virtual void grpc_call_ref(grpc_call* call) = 0;
virtual void grpc_call_unref(grpc_call* call) = 0;
virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) = 0;
virtual grpc_slice grpc_empty_slice() = 0;
virtual grpc_slice grpc_slice_malloc(size_t length) = 0; virtual grpc_slice grpc_slice_malloc(size_t length) = 0;
virtual void grpc_slice_unref(grpc_slice slice) = 0; virtual void grpc_slice_unref(grpc_slice slice) = 0;
virtual grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) = 0; virtual grpc_slice grpc_slice_split_tail(grpc_slice* s, size_t split) = 0;

@ -51,18 +51,26 @@ extern GrpcLibraryInterface* g_glip;
/// Classes that require gRPC to be initialized should inherit from this class. /// Classes that require gRPC to be initialized should inherit from this class.
class GrpcLibraryCodegen { class GrpcLibraryCodegen {
public: public:
GrpcLibraryCodegen() { GrpcLibraryCodegen(bool call_grpc_init = true) : grpc_init_called_(false) {
GPR_CODEGEN_ASSERT(g_glip && if (call_grpc_init) {
"gRPC library not initialized. See " GPR_CODEGEN_ASSERT(g_glip &&
"grpc::internal::GrpcLibraryInitializer."); "gRPC library not initialized. See "
g_glip->init(); "grpc::internal::GrpcLibraryInitializer.");
g_glip->init();
grpc_init_called_ = true;
}
} }
virtual ~GrpcLibraryCodegen() { virtual ~GrpcLibraryCodegen() {
GPR_CODEGEN_ASSERT(g_glip && if (grpc_init_called_) {
"gRPC library not initialized. See " GPR_CODEGEN_ASSERT(g_glip &&
"grpc::internal::GrpcLibraryInitializer."); "gRPC library not initialized. See "
g_glip->shutdown(); "grpc::internal::GrpcLibraryInitializer.");
g_glip->shutdown();
}
} }
private:
bool grpc_init_called_;
}; };
} // namespace grpc } // namespace grpc

@ -52,7 +52,7 @@ namespace internal {
class GrpcBufferWriterPeer; class GrpcBufferWriterPeer;
const int kGrpcBufferWriterMaxBufferLength = 8192; const int kGrpcBufferWriterMaxBufferLength = 1024 * 1024;
class GrpcBufferWriter final class GrpcBufferWriter final
: public ::grpc::protobuf::io::ZeroCopyOutputStream { : public ::grpc::protobuf::io::ZeroCopyOutputStream {

@ -39,8 +39,8 @@
#include <vector> #include <vector>
#include <grpc/impl/codegen/compression_types.h> #include <grpc/impl/codegen/compression_types.h>
#include <grpc/load_reporting.h>
#include <grpc++/impl/codegen/completion_queue_tag.h>
#include <grpc++/impl/codegen/config.h> #include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/create_auth_context.h> #include <grpc++/impl/codegen/create_auth_context.h>
#include <grpc++/impl/codegen/metadata_map.h> #include <grpc++/impl/codegen/metadata_map.h>
@ -212,6 +212,8 @@ class ServerContext {
class CompletionOp; class CompletionOp;
void BeginCompletionOp(Call* call); void BeginCompletionOp(Call* call);
// Return the tag queued by BeginCompletionOp()
CompletionQueueTag* GetCompletionOpTag();
ServerContext(gpr_timespec deadline, grpc_metadata_array* arr); ServerContext(gpr_timespec deadline, grpc_metadata_array* arr);

@ -122,9 +122,7 @@ class ServerInterface : public CallHook {
/// caller is required to keep all completion queues live until the server is /// caller is required to keep all completion queues live until the server is
/// destroyed. /// destroyed.
/// \param num_cqs How many completion queues does \a cqs hold. /// \param num_cqs How many completion queues does \a cqs hold.
/// virtual void Start(ServerCompletionQueue** cqs, size_t num_cqs) = 0;
/// \return true on a successful shutdown.
virtual bool Start(ServerCompletionQueue** cqs, size_t num_cqs) = 0;
virtual void ShutdownInternal(gpr_timespec deadline) = 0; virtual void ShutdownInternal(gpr_timespec deadline) = 0;

@ -47,10 +47,16 @@ class Status {
/// Construct an OK instance. /// Construct an OK instance.
Status() : code_(StatusCode::OK) {} Status() : code_(StatusCode::OK) {}
/// Construct an instance with associated \a code and \a details (also /// Construct an instance with associated \a code and \a error_message
// referred to as "error_message"). Status(StatusCode code, const grpc::string& error_message)
Status(StatusCode code, const grpc::string& details) : code_(code), error_message_(error_message) {}
: code_(code), details_(details) {}
/// Construct an instance with \a code, \a error_message and \a error_details
Status(StatusCode code, const grpc::string& error_message,
const grpc::string& error_details)
: code_(code),
error_message_(error_message),
binary_error_details_(error_details) {}
// Pre-defined special status objects. // Pre-defined special status objects.
/// An OK pre-defined instance. /// An OK pre-defined instance.
@ -61,14 +67,18 @@ class Status {
/// Return the instance's error code. /// Return the instance's error code.
StatusCode error_code() const { return code_; } StatusCode error_code() const { return code_; }
/// Return the instance's error message. /// Return the instance's error message.
grpc::string error_message() const { return details_; } grpc::string error_message() const { return error_message_; }
/// Return the (binary) error details.
// Usually it contains a serialized google.rpc.Status proto.
grpc::string error_details() const { return binary_error_details_; }
/// Is the status OK? /// Is the status OK?
bool ok() const { return code_ == StatusCode::OK; } bool ok() const { return code_ == StatusCode::OK; }
private: private:
StatusCode code_; StatusCode code_;
grpc::string details_; grpc::string error_message_;
grpc::string binary_error_details_;
}; };
} // namespace grpc } // namespace grpc

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save