Merge branch 'master' into v1.3.x

pull/10770/merge^2
Yuchen Zeng 8 years ago committed by GitHub
commit 79759fea1a
  1. 10
      .gitignore
  2. 140
      BUILD
  3. 167
      CMakeLists.txt
  4. 268
      Makefile
  5. 9
      README.md
  6. 11
      WORKSPACE
  7. 4
      bazel/BUILD
  8. 6
      bazel/cc_grpc_library.bzl
  9. 17
      bazel/generate_cc.bzl
  10. 19
      bazel/grpc_build_system.bzl
  11. 11
      binding.gyp
  12. 103
      build.yaml
  13. 2
      build_config.rb
  14. 17
      config.m4
  15. 2
      doc/binary-logging.md
  16. 6
      doc/interop-test-descriptions.md
  17. 4
      doc/server_side_auth.md
  18. 21
      doc/service_config.md
  19. 2
      examples/cpp/README.md
  20. 2
      examples/cpp/cpptutorial.md
  21. 34
      examples/csharp/helloworld-from-cli/Greeter.sln
  22. 19
      examples/csharp/helloworld-from-cli/Greeter/Greeter.csproj
  23. 37
      examples/csharp/helloworld-from-cli/Greeter/Helloworld.cs
  24. 73
      examples/csharp/helloworld-from-cli/Greeter/HelloworldGrpc.cs
  25. 31
      examples/csharp/helloworld-from-cli/Greeter/project.json
  26. 17
      examples/csharp/helloworld-from-cli/GreeterClient/GreeterClient.csproj
  27. 35
      examples/csharp/helloworld-from-cli/GreeterClient/project.json
  28. 17
      examples/csharp/helloworld-from-cli/GreeterServer/GreeterServer.csproj
  29. 35
      examples/csharp/helloworld-from-cli/GreeterServer/project.json
  30. 17
      examples/csharp/helloworld-from-cli/README.md
  31. 42
      examples/csharp/helloworld-from-cli/generate_protos.bat
  32. 5
      examples/csharp/helloworld-from-cli/global.json
  33. 29
      examples/csharp/helloworld/Greeter/Greeter.csproj
  34. 37
      examples/csharp/helloworld/Greeter/Helloworld.cs
  35. 73
      examples/csharp/helloworld/Greeter/HelloworldGrpc.cs
  36. 12
      examples/csharp/helloworld/Greeter/packages.config
  37. 29
      examples/csharp/helloworld/GreeterClient/GreeterClient.csproj
  38. 10
      examples/csharp/helloworld/GreeterClient/packages.config
  39. 29
      examples/csharp/helloworld/GreeterServer/GreeterServer.csproj
  40. 10
      examples/csharp/helloworld/GreeterServer/packages.config
  41. 2
      examples/csharp/helloworld/generate_protos.bat
  42. 2
      examples/csharp/route_guide/README.md
  43. 46
      examples/csharp/route_guide/RouteGuide/RouteGuide.cs
  44. 31
      examples/csharp/route_guide/RouteGuide/RouteGuide.csproj
  45. 248
      examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
  46. 10
      examples/csharp/route_guide/RouteGuide/packages.config
  47. 29
      examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj
  48. 10
      examples/csharp/route_guide/RouteGuideClient/packages.config
  49. 31
      examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj
  50. 12
      examples/csharp/route_guide/RouteGuideServer/packages.config
  51. 2
      examples/csharp/route_guide/generate_protos.bat
  52. 2
      examples/node/dynamic_codegen/route_guide/README.md
  53. 2
      examples/node/static_codegen/route_guide/README.md
  54. 2
      examples/objective-c/auth_sample/README.md
  55. 2
      examples/objective-c/helloworld/README.md
  56. 2
      examples/objective-c/route_guide/README.md
  57. 2
      examples/php/route_guide/README.md
  58. 2
      examples/ruby/errors_and_cancellation/README.md
  59. 2
      examples/ruby/route_guide/README.md
  60. 35
      gRPC-Core.podspec
  61. 2
      gRPC-ProtoRPC.podspec
  62. 2
      gRPC-RxLibrary.podspec
  63. 2
      gRPC.podspec
  64. 6
      grpc.def
  65. 21
      grpc.gemspec
  66. 129
      include/grpc++/impl/codegen/async_stream.h
  67. 91
      include/grpc++/impl/codegen/async_unary_call.h
  68. 40
      include/grpc++/impl/codegen/call.h
  69. 4
      include/grpc++/impl/codegen/client_unary_call.h
  70. 50
      include/grpc++/impl/codegen/completion_queue.h
  71. 19
      include/grpc++/impl/codegen/core_codegen.h
  72. 12
      include/grpc++/impl/codegen/core_codegen_interface.h
  73. 3
      include/grpc++/impl/codegen/server_context.h
  74. 4
      include/grpc++/impl/codegen/server_interface.h
  75. 47
      include/grpc++/impl/codegen/status_helper.h
  76. 20
      include/grpc++/impl/codegen/sync_stream.h
  77. 7
      include/grpc++/server.h
  78. 5
      include/grpc++/server_builder.h
  79. 163
      include/grpc++/test/mock_stream.h
  80. 84
      include/grpc/grpc.h
  81. 66
      include/grpc/impl/codegen/grpc_types.h
  82. 12
      include/grpc/load_reporting.h
  83. 6
      include/grpc/slice.h
  84. 2
      package.json
  85. 25
      package.xml
  86. 199
      src/compiler/cpp_generator.cc
  87. 34
      src/compiler/cpp_generator.h
  88. 21
      src/compiler/cpp_plugin.cc
  89. 1
      src/compiler/objective_c_plugin.cc
  90. 8
      src/compiler/python_generator.cc
  91. 2
      src/core/ext/census/context.c
  92. 4
      src/core/ext/census/resource.c
  93. 130
      src/core/ext/filters/client_channel/client_channel.c
  94. 5
      src/core/ext/filters/client_channel/client_channel_plugin.c
  95. 28
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c
  96. 27
      src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c
  97. 97
      src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h
  98. 33
      src/core/ext/filters/client_channel/lb_policy_factory.c
  99. 22
      src/core/ext/filters/client_channel/lb_policy_factory.h
  100. 44
      src/core/ext/filters/client_channel/parse_address.c
  101. Some files were not shown because too many files have changed in this diff Show More

10
.gitignore vendored

@ -118,3 +118,13 @@ gdb.txt
# ctags file # ctags file
tags tags
# perf data
perf.data
perf.data.old
# bm_diff
bm_diff_new/
bm_diff_old/
bm_*.json

140
BUILD

@ -35,14 +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")
# This should be updated along with build.yaml # This should be updated along with build.yaml
g_stands_for = "gentle" g_stands_for = "gentle"
core_version = "3.0.0-pre1" core_version = "3.0.0-dev"
version = "1.3.0-pre1" version = "1.4.0-dev"
grpc_cc_library( grpc_cc_library(
name = "gpr", name = "gpr",
@ -53,30 +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_max_age_filter",
"grpc_resolver_dns_ares",
"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",
],
[],
], ],
) )
@ -91,30 +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_max_age_filter",
"grpc_resolver_dns_native",
"grpc_resolver_sockaddr",
"grpc_transport_chttp2_client_insecure",
"grpc_transport_chttp2_server_insecure",
], ],
) )
@ -158,7 +151,7 @@ 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",
@ -451,15 +444,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",
@ -578,16 +566,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",
@ -756,6 +739,7 @@ grpc_cc_library(
language = "c", language = "c",
deps = [ deps = [
"grpc_base", "grpc_base",
"grpc_deadline_filter",
], ],
) )
@ -773,6 +757,53 @@ grpc_cc_library(
], ],
) )
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 = [
"src/core/ext/filters/message_size/message_size_filter.h",
],
language = "c",
deps = [
"grpc_base",
],
)
grpc_cc_library(
name = "grpc_http_filters",
hdrs = [
"src/core/ext/filters/http/message_compress/message_compress_filter.h",
"src/core/ext/filters/http/client/http_client_filter.h",
"src/core/ext/filters/http/server/http_server_filter.h",
],
srcs = [
"src/core/ext/filters/http/message_compress/message_compress_filter.c",
"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",
deps = [
"grpc_base",
],
)
grpc_cc_library( grpc_cc_library(
name = "grpc_codegen", name = "grpc_codegen",
language = "c", language = "c",
@ -1035,6 +1066,7 @@ grpc_cc_library(
deps = [ deps = [
"grpc_base", "grpc_base",
"grpc_transport_chttp2_alpn", "grpc_transport_chttp2_alpn",
"grpc_http_filters",
], ],
) )
@ -1187,8 +1219,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",
@ -1223,7 +1259,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",
@ -1232,7 +1268,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",
@ -1282,9 +1318,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",
], ],
) )
@ -1318,7 +1353,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",

@ -39,7 +39,7 @@
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
set(PACKAGE_NAME "grpc") set(PACKAGE_NAME "grpc")
set(PACKAGE_VERSION "1.3.0-pre1") set(PACKAGE_VERSION "1.4.0-dev")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")
@ -269,8 +269,10 @@ if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif() endif()
if(UNIX) if(_gRPC_PLATFORM_MAC)
set(_gRPC_ALLTARGETS_LIBRARIES dl rt m pthread) set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread)
elseif(UNIX)
set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} rt m pthread)
endif() endif()
if(WIN32 AND MSVC) if(WIN32 AND MSVC)
@ -391,6 +393,7 @@ add_dependencies(buildtests_c error_test)
if(_gRPC_PLATFORM_LINUX) if(_gRPC_PLATFORM_LINUX)
add_dependencies(buildtests_c ev_epoll_linux_test) add_dependencies(buildtests_c ev_epoll_linux_test)
endif() endif()
add_dependencies(buildtests_c fake_resolver_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c fd_conservation_posix_test) add_dependencies(buildtests_c fd_conservation_posix_test)
endif() endif()
@ -471,6 +474,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c memory_profile_test) add_dependencies(buildtests_c memory_profile_test)
endif() endif()
add_dependencies(buildtests_c message_compress_test) add_dependencies(buildtests_c message_compress_test)
add_dependencies(buildtests_c minimal_stack_is_minimal_test)
add_dependencies(buildtests_c mlog_test) add_dependencies(buildtests_c mlog_test)
add_dependencies(buildtests_c multiple_server_queues_test) add_dependencies(buildtests_c multiple_server_queues_test)
add_dependencies(buildtests_c murmur_hash_test) add_dependencies(buildtests_c murmur_hash_test)
@ -491,6 +495,7 @@ add_dependencies(buildtests_c sequential_connectivity_test)
add_dependencies(buildtests_c server_chttp2_test) add_dependencies(buildtests_c server_chttp2_test)
add_dependencies(buildtests_c server_test) add_dependencies(buildtests_c server_test)
add_dependencies(buildtests_c slice_buffer_test) add_dependencies(buildtests_c slice_buffer_test)
add_dependencies(buildtests_c slice_hash_table_test)
add_dependencies(buildtests_c slice_string_helpers_test) add_dependencies(buildtests_c slice_string_helpers_test)
add_dependencies(buildtests_c slice_test) add_dependencies(buildtests_c slice_test)
add_dependencies(buildtests_c sockaddr_resolver_test) add_dependencies(buildtests_c sockaddr_resolver_test)
@ -913,15 +918,10 @@ add_library(grpc
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
@ -1058,6 +1058,10 @@ add_library(grpc
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
@ -1107,6 +1111,7 @@ add_library(grpc
src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel.c
src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/subchannel_index.c
src/core/ext/filters/client_channel/uri_parser.c src/core/ext/filters/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
@ -1143,6 +1148,7 @@ add_library(grpc
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/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
) )
@ -1237,15 +1243,10 @@ add_library(grpc_cronet
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
@ -1385,6 +1386,10 @@ add_library(grpc_cronet
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/ext/filters/client_channel/channel_connectivity.c src/core/ext/filters/client_channel/channel_connectivity.c
src/core/ext/filters/client_channel/client_channel.c src/core/ext/filters/client_channel/client_channel.c
src/core/ext/filters/client_channel/client_channel_factory.c src/core/ext/filters/client_channel/client_channel_factory.c
@ -1405,6 +1410,7 @@ add_library(grpc_cronet
src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel.c
src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/subchannel_index.c
src/core/ext/filters/client_channel/uri_parser.c src/core/ext/filters/client_channel/uri_parser.c
src/core/ext/filters/deadline/deadline_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
@ -1547,15 +1553,10 @@ add_library(grpc_test_util
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
@ -1808,15 +1809,10 @@ add_library(grpc_unsecure
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
@ -1954,6 +1950,10 @@ add_library(grpc_unsecure
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/ext/transport/chttp2/server/chttp2_server.c src/core/ext/transport/chttp2/server/chttp2_server.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
@ -1978,6 +1978,7 @@ add_library(grpc_unsecure
src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel.c
src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/subchannel_index.c
src/core/ext/filters/client_channel/uri_parser.c src/core/ext/filters/client_channel/uri_parser.c
src/core/ext/filters/deadline/deadline_filter.c
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c 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_ev_driver_posix.c
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c
@ -2009,6 +2010,7 @@ add_library(grpc_unsecure
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/max_age/max_age_filter.c
src/core/ext/filters/message_size/message_size_filter.c
src/core/plugin_registry/grpc_unsecure_plugin_registry.c src/core/plugin_registry/grpc_unsecure_plugin_registry.c
) )
@ -2226,15 +2228,10 @@ add_library(grpc++
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
@ -2462,7 +2459,6 @@ foreach(_hdr
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
@ -2557,15 +2553,10 @@ add_library(grpc++_cronet
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
@ -2708,6 +2699,10 @@ add_library(grpc++_cronet
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/ext/filters/client_channel/channel_connectivity.c src/core/ext/filters/client_channel/channel_connectivity.c
src/core/ext/filters/client_channel/client_channel.c src/core/ext/filters/client_channel/client_channel.c
src/core/ext/filters/client_channel/client_channel_factory.c src/core/ext/filters/client_channel/client_channel_factory.c
@ -2728,6 +2723,7 @@ add_library(grpc++_cronet
src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel.c
src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/subchannel_index.c
src/core/ext/filters/client_channel/uri_parser.c src/core/ext/filters/client_channel/uri_parser.c
src/core/ext/filters/deadline/deadline_filter.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/server/chttp2_server.c src/core/ext/transport/chttp2/server/chttp2_server.c
@ -2855,7 +2851,6 @@ foreach(_hdr
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
@ -3245,7 +3240,6 @@ foreach(_hdr
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
@ -3323,15 +3317,10 @@ add_library(grpc++_unsecure
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
@ -3558,7 +3547,6 @@ foreach(_hdr
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
@ -5456,6 +5444,37 @@ target_link_libraries(ev_epoll_linux_test
) )
endif() endif()
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(fake_resolver_test
test/core/client_channel/resolvers/fake_resolver_test.c
)
target_include_directories(fake_resolver_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CARES_BUILD_INCLUDE_DIR}
PRIVATE ${CARES_INCLUDE_DIR}
PRIVATE ${CARES_PLATFORM_INCLUDE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
)
target_link_libraries(fake_resolver_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr_test_util
gpr
)
endif (gRPC_BUILD_TESTS) endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@ -7458,6 +7477,37 @@ target_link_libraries(message_compress_test
endif (gRPC_BUILD_TESTS) endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS)
add_executable(minimal_stack_is_minimal_test
test/core/channel/minimal_stack_is_minimal_test.c
)
target_include_directories(minimal_stack_is_minimal_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CARES_BUILD_INCLUDE_DIR}
PRIVATE ${CARES_INCLUDE_DIR}
PRIVATE ${CARES_PLATFORM_INCLUDE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
)
target_link_libraries(minimal_stack_is_minimal_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr_test_util
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(mlog_test add_executable(mlog_test
test/core/census/mlog_test.c test/core/census/mlog_test.c
) )
@ -7956,6 +8006,37 @@ target_link_libraries(slice_buffer_test
endif (gRPC_BUILD_TESTS) endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS)
add_executable(slice_hash_table_test
test/core/slice/slice_hash_table_test.c
)
target_include_directories(slice_hash_table_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CARES_BUILD_INCLUDE_DIR}
PRIVATE ${CARES_INCLUDE_DIR}
PRIVATE ${CARES_PLATFORM_INCLUDE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
)
target_link_libraries(slice_hash_table_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr_test_util
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(slice_string_helpers_test add_executable(slice_string_helpers_test
test/core/slice/slice_string_helpers_test.c test/core/slice/slice_string_helpers_test.c
) )
@ -9728,6 +9809,8 @@ target_include_directories(codegen_test_minimal
target_link_libraries(codegen_test_minimal target_link_libraries(codegen_test_minimal
${_gRPC_PROTOBUF_LIBRARIES} ${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES} ${_gRPC_ALLTARGETS_LIBRARIES}
grpc
gpr
${_gRPC_GFLAGS_LIBRARIES} ${_gRPC_GFLAGS_LIBRARIES}
) )

@ -157,6 +157,15 @@ LDXX_asan-noleaks = clang++
CPPFLAGS_asan-noleaks = -O0 -fsanitize-coverage=edge -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS CPPFLAGS_asan-noleaks = -O0 -fsanitize-coverage=edge -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument -DGPR_NO_DIRECT_SYSCALLS
LDFLAGS_asan-noleaks = -fsanitize=address LDFLAGS_asan-noleaks = -fsanitize=address
VALID_CONFIG_c++-compat = 1
CC_c++-compat = $(DEFAULT_CC)
CXX_c++-compat = $(DEFAULT_CXX)
LD_c++-compat = $(DEFAULT_CC)
LDXX_c++-compat = $(DEFAULT_CXX)
CFLAGS_c++-compat = -Wc++-compat
CPPFLAGS_c++-compat = -O0
DEFINES_c++-compat = _DEBUG DEBUG
VALID_CONFIG_ubsan = 1 VALID_CONFIG_ubsan = 1
REQUIRE_CUSTOM_LIBRARIES_ubsan = 1 REQUIRE_CUSTOM_LIBRARIES_ubsan = 1
CC_ubsan = clang CC_ubsan = clang
@ -165,7 +174,7 @@ LD_ubsan = clang
LDXX_ubsan = clang++ LDXX_ubsan = clang++
CPPFLAGS_ubsan = -O0 -fsanitize-coverage=edge -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument -Wvarargs CPPFLAGS_ubsan = -O0 -fsanitize-coverage=edge -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument -Wvarargs
LDFLAGS_ubsan = -fsanitize=undefined,unsigned-integer-overflow LDFLAGS_ubsan = -fsanitize=undefined,unsigned-integer-overflow
DEFINES_ubsan = NDEBUG DEFINES_ubsan = NDEBUG GRPC_UBSAN
VALID_CONFIG_tsan = 1 VALID_CONFIG_tsan = 1
REQUIRE_CUSTOM_LIBRARIES_tsan = 1 REQUIRE_CUSTOM_LIBRARIES_tsan = 1
@ -409,7 +418,7 @@ AROPTS = $(GRPC_CROSS_AROPTS) # e.g., rc --target=elf32-little
USE_BUILT_PROTOC = false USE_BUILT_PROTOC = false
endif endif
GTEST_LIB = -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googletest third_party/googletest/googletest/src/gtest-all.cc GTEST_LIB = -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googletest third_party/googletest/googletest/src/gtest-all.cc -Ithird_party/googletest/googlemock/include -Ithird_party/googletest/googlemock third_party/googletest/googlemock/src/gmock-all.cc
GTEST_LIB += -lgflags GTEST_LIB += -lgflags
ifeq ($(V),1) ifeq ($(V),1)
E = @: E = @:
@ -419,9 +428,9 @@ E = @echo
Q = @ Q = @
endif endif
CORE_VERSION = 3.0.0-pre1 CORE_VERSION = 4.0.0-dev
CPP_VERSION = 1.3.0-pre1 CPP_VERSION = 1.4.0-dev
CSHARP_VERSION = 1.3.0-pre1 CSHARP_VERSION = 1.4.0-dev
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
@ -469,7 +478,7 @@ SHARED_EXT_CORE = dll
SHARED_EXT_CPP = dll SHARED_EXT_CPP = dll
SHARED_EXT_CSHARP = dll SHARED_EXT_CSHARP = dll
SHARED_PREFIX = SHARED_PREFIX =
SHARED_VERSION_CORE = -3 SHARED_VERSION_CORE = -4
SHARED_VERSION_CPP = -1 SHARED_VERSION_CPP = -1
SHARED_VERSION_CSHARP = -1 SHARED_VERSION_CSHARP = -1
else ifeq ($(SYSTEM),Darwin) else ifeq ($(SYSTEM),Darwin)
@ -784,7 +793,7 @@ PROTOBUF_PKG_CONFIG = false
PC_REQUIRES_GRPCXX = PC_REQUIRES_GRPCXX =
PC_LIBS_GRPCXX = PC_LIBS_GRPCXX =
CPPFLAGS := -Ithird_party/googletest/googletest/include $(CPPFLAGS) CPPFLAGS := -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include $(CPPFLAGS)
PROTOC_PLUGINS_ALL = $(BINDIR)/$(CONFIG)/grpc_cpp_plugin $(BINDIR)/$(CONFIG)/grpc_csharp_plugin $(BINDIR)/$(CONFIG)/grpc_node_plugin $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin $(BINDIR)/$(CONFIG)/grpc_php_plugin $(BINDIR)/$(CONFIG)/grpc_python_plugin $(BINDIR)/$(CONFIG)/grpc_ruby_plugin PROTOC_PLUGINS_ALL = $(BINDIR)/$(CONFIG)/grpc_cpp_plugin $(BINDIR)/$(CONFIG)/grpc_csharp_plugin $(BINDIR)/$(CONFIG)/grpc_node_plugin $(BINDIR)/$(CONFIG)/grpc_objective_c_plugin $(BINDIR)/$(CONFIG)/grpc_php_plugin $(BINDIR)/$(CONFIG)/grpc_python_plugin $(BINDIR)/$(CONFIG)/grpc_ruby_plugin
PROTOC_PLUGINS_DIR = $(BINDIR)/$(CONFIG) PROTOC_PLUGINS_DIR = $(BINDIR)/$(CONFIG)
@ -981,6 +990,7 @@ dualstack_socket_test: $(BINDIR)/$(CONFIG)/dualstack_socket_test
endpoint_pair_test: $(BINDIR)/$(CONFIG)/endpoint_pair_test endpoint_pair_test: $(BINDIR)/$(CONFIG)/endpoint_pair_test
error_test: $(BINDIR)/$(CONFIG)/error_test error_test: $(BINDIR)/$(CONFIG)/error_test
ev_epoll_linux_test: $(BINDIR)/$(CONFIG)/ev_epoll_linux_test ev_epoll_linux_test: $(BINDIR)/$(CONFIG)/ev_epoll_linux_test
fake_resolver_test: $(BINDIR)/$(CONFIG)/fake_resolver_test
fd_conservation_posix_test: $(BINDIR)/$(CONFIG)/fd_conservation_posix_test fd_conservation_posix_test: $(BINDIR)/$(CONFIG)/fd_conservation_posix_test
fd_posix_test: $(BINDIR)/$(CONFIG)/fd_posix_test fd_posix_test: $(BINDIR)/$(CONFIG)/fd_posix_test
fling_client: $(BINDIR)/$(CONFIG)/fling_client fling_client: $(BINDIR)/$(CONFIG)/fling_client
@ -1050,6 +1060,7 @@ memory_profile_client: $(BINDIR)/$(CONFIG)/memory_profile_client
memory_profile_server: $(BINDIR)/$(CONFIG)/memory_profile_server memory_profile_server: $(BINDIR)/$(CONFIG)/memory_profile_server
memory_profile_test: $(BINDIR)/$(CONFIG)/memory_profile_test memory_profile_test: $(BINDIR)/$(CONFIG)/memory_profile_test
message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test
minimal_stack_is_minimal_test: $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test
mlog_test: $(BINDIR)/$(CONFIG)/mlog_test mlog_test: $(BINDIR)/$(CONFIG)/mlog_test
multiple_server_queues_test: $(BINDIR)/$(CONFIG)/multiple_server_queues_test multiple_server_queues_test: $(BINDIR)/$(CONFIG)/multiple_server_queues_test
murmur_hash_test: $(BINDIR)/$(CONFIG)/murmur_hash_test murmur_hash_test: $(BINDIR)/$(CONFIG)/murmur_hash_test
@ -1071,6 +1082,7 @@ server_chttp2_test: $(BINDIR)/$(CONFIG)/server_chttp2_test
server_fuzzer: $(BINDIR)/$(CONFIG)/server_fuzzer server_fuzzer: $(BINDIR)/$(CONFIG)/server_fuzzer
server_test: $(BINDIR)/$(CONFIG)/server_test server_test: $(BINDIR)/$(CONFIG)/server_test
slice_buffer_test: $(BINDIR)/$(CONFIG)/slice_buffer_test slice_buffer_test: $(BINDIR)/$(CONFIG)/slice_buffer_test
slice_hash_table_test: $(BINDIR)/$(CONFIG)/slice_hash_table_test
slice_string_helpers_test: $(BINDIR)/$(CONFIG)/slice_string_helpers_test slice_string_helpers_test: $(BINDIR)/$(CONFIG)/slice_string_helpers_test
slice_test: $(BINDIR)/$(CONFIG)/slice_test slice_test: $(BINDIR)/$(CONFIG)/slice_test
sockaddr_resolver_test: $(BINDIR)/$(CONFIG)/sockaddr_resolver_test sockaddr_resolver_test: $(BINDIR)/$(CONFIG)/sockaddr_resolver_test
@ -1365,6 +1377,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/endpoint_pair_test \ $(BINDIR)/$(CONFIG)/endpoint_pair_test \
$(BINDIR)/$(CONFIG)/error_test \ $(BINDIR)/$(CONFIG)/error_test \
$(BINDIR)/$(CONFIG)/ev_epoll_linux_test \ $(BINDIR)/$(CONFIG)/ev_epoll_linux_test \
$(BINDIR)/$(CONFIG)/fake_resolver_test \
$(BINDIR)/$(CONFIG)/fd_conservation_posix_test \ $(BINDIR)/$(CONFIG)/fd_conservation_posix_test \
$(BINDIR)/$(CONFIG)/fd_posix_test \ $(BINDIR)/$(CONFIG)/fd_posix_test \
$(BINDIR)/$(CONFIG)/fling_client \ $(BINDIR)/$(CONFIG)/fling_client \
@ -1423,6 +1436,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/memory_profile_server \ $(BINDIR)/$(CONFIG)/memory_profile_server \
$(BINDIR)/$(CONFIG)/memory_profile_test \ $(BINDIR)/$(CONFIG)/memory_profile_test \
$(BINDIR)/$(CONFIG)/message_compress_test \ $(BINDIR)/$(CONFIG)/message_compress_test \
$(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test \
$(BINDIR)/$(CONFIG)/mlog_test \ $(BINDIR)/$(CONFIG)/mlog_test \
$(BINDIR)/$(CONFIG)/multiple_server_queues_test \ $(BINDIR)/$(CONFIG)/multiple_server_queues_test \
$(BINDIR)/$(CONFIG)/murmur_hash_test \ $(BINDIR)/$(CONFIG)/murmur_hash_test \
@ -1439,6 +1453,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/server_chttp2_test \ $(BINDIR)/$(CONFIG)/server_chttp2_test \
$(BINDIR)/$(CONFIG)/server_test \ $(BINDIR)/$(CONFIG)/server_test \
$(BINDIR)/$(CONFIG)/slice_buffer_test \ $(BINDIR)/$(CONFIG)/slice_buffer_test \
$(BINDIR)/$(CONFIG)/slice_hash_table_test \
$(BINDIR)/$(CONFIG)/slice_string_helpers_test \ $(BINDIR)/$(CONFIG)/slice_string_helpers_test \
$(BINDIR)/$(CONFIG)/slice_test \ $(BINDIR)/$(CONFIG)/slice_test \
$(BINDIR)/$(CONFIG)/sockaddr_resolver_test \ $(BINDIR)/$(CONFIG)/sockaddr_resolver_test \
@ -1775,6 +1790,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/error_test || ( echo test error_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/error_test || ( echo test error_test failed ; exit 1 )
$(E) "[RUN] Testing ev_epoll_linux_test" $(E) "[RUN] Testing ev_epoll_linux_test"
$(Q) $(BINDIR)/$(CONFIG)/ev_epoll_linux_test || ( echo test ev_epoll_linux_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/ev_epoll_linux_test || ( echo test ev_epoll_linux_test failed ; exit 1 )
$(E) "[RUN] Testing fake_resolver_test"
$(Q) $(BINDIR)/$(CONFIG)/fake_resolver_test || ( echo test fake_resolver_test failed ; exit 1 )
$(E) "[RUN] Testing fd_conservation_posix_test" $(E) "[RUN] Testing fd_conservation_posix_test"
$(Q) $(BINDIR)/$(CONFIG)/fd_conservation_posix_test || ( echo test fd_conservation_posix_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/fd_conservation_posix_test || ( echo test fd_conservation_posix_test failed ; exit 1 )
$(E) "[RUN] Testing fd_posix_test" $(E) "[RUN] Testing fd_posix_test"
@ -1877,6 +1894,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/memory_profile_test || ( echo test memory_profile_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/memory_profile_test || ( echo test memory_profile_test failed ; exit 1 )
$(E) "[RUN] Testing message_compress_test" $(E) "[RUN] Testing message_compress_test"
$(Q) $(BINDIR)/$(CONFIG)/message_compress_test || ( echo test message_compress_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/message_compress_test || ( echo test message_compress_test failed ; exit 1 )
$(E) "[RUN] Testing minimal_stack_is_minimal_test"
$(Q) $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test || ( echo test minimal_stack_is_minimal_test failed ; exit 1 )
$(E) "[RUN] Testing multiple_server_queues_test" $(E) "[RUN] Testing multiple_server_queues_test"
$(Q) $(BINDIR)/$(CONFIG)/multiple_server_queues_test || ( echo test multiple_server_queues_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/multiple_server_queues_test || ( echo test multiple_server_queues_test failed ; exit 1 )
$(E) "[RUN] Testing murmur_hash_test" $(E) "[RUN] Testing murmur_hash_test"
@ -1907,6 +1926,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/server_test || ( echo test server_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/server_test || ( echo test server_test failed ; exit 1 )
$(E) "[RUN] Testing slice_buffer_test" $(E) "[RUN] Testing slice_buffer_test"
$(Q) $(BINDIR)/$(CONFIG)/slice_buffer_test || ( echo test slice_buffer_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/slice_buffer_test || ( echo test slice_buffer_test failed ; exit 1 )
$(E) "[RUN] Testing slice_hash_table_test"
$(Q) $(BINDIR)/$(CONFIG)/slice_hash_table_test || ( echo test slice_hash_table_test failed ; exit 1 )
$(E) "[RUN] Testing slice_string_helpers_test" $(E) "[RUN] Testing slice_string_helpers_test"
$(Q) $(BINDIR)/$(CONFIG)/slice_string_helpers_test || ( echo test slice_string_helpers_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/slice_string_helpers_test || ( echo test slice_string_helpers_test failed ; exit 1 )
$(E) "[RUN] Testing slice_test" $(E) "[RUN] Testing slice_test"
@ -2217,6 +2238,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/health/v1/health.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/health/v1/health.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/health/v1/health.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/health/v1/health.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/health/v1/health.pb.cc: src/proto/grpc/health/v1/health.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/health/v1/health.pb.cc: src/proto/grpc/health/v1/health.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2232,6 +2254,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc: src/proto/grpc/lb/v1/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/lb/v1/load_balancer.pb.cc: src/proto/grpc/lb/v1/load_balancer.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2247,6 +2270,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: src/proto/grpc/reflection/v1alpha/reflection.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc: src/proto/grpc/reflection/v1alpha/reflection.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2262,6 +2286,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/status/status.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/status/status.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/status/status.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/status/status.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/status/status.pb.cc: src/proto/grpc/status/status.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/status/status.pb.cc: src/proto/grpc/status/status.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2277,6 +2302,8 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: src/proto/grpc/testing/compiler_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: src/proto/grpc/testing/compiler_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2285,13 +2312,14 @@ $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: src/proto/grpc/testing/com
$(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: src/proto/grpc/testing/compiler_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: src/proto/grpc/testing/compiler_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=generate_mock_code=true:$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $<
endif endif
ifeq ($(NO_PROTOC),true) ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/control.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/control.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/control.pb.cc: src/proto/grpc/testing/control.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc: src/proto/grpc/testing/control.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2307,6 +2335,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc: src/proto/grpc/testing/duplicate/echo_duplicate.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/duplicate/echo_duplicate.pb.cc: src/proto/grpc/testing/duplicate/echo_duplicate.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2322,6 +2351,8 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/echo.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/echo.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/echo.pb.cc: src/proto/grpc/testing/echo.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.pb.cc: src/proto/grpc/testing/echo.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2330,13 +2361,14 @@ $(GENDIR)/src/proto/grpc/testing/echo.pb.cc: src/proto/grpc/testing/echo.proto $
$(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc: src/proto/grpc/testing/echo.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc: src/proto/grpc/testing/echo.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<" $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=generate_mock_code=true:$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $<
endif endif
ifeq ($(NO_PROTOC),true) ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc: src/proto/grpc/testing/echo_messages.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc: src/proto/grpc/testing/echo_messages.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2352,6 +2384,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/empty.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/empty.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/empty.pb.cc: src/proto/grpc/testing/empty.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/empty.pb.cc: src/proto/grpc/testing/empty.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2367,6 +2400,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/messages.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/messages.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/messages.pb.cc: src/proto/grpc/testing/messages.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/messages.pb.cc: src/proto/grpc/testing/messages.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2382,6 +2416,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/metrics.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/metrics.pb.cc: src/proto/grpc/testing/metrics.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc: src/proto/grpc/testing/metrics.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2397,6 +2432,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/payloads.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/payloads.pb.cc: src/proto/grpc/testing/payloads.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc: src/proto/grpc/testing/payloads.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2412,6 +2448,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/services.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/services.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/services.pb.cc: src/proto/grpc/testing/services.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc: src/proto/grpc/testing/services.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2427,6 +2464,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/stats.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/stats.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/stats.pb.cc: src/proto/grpc/testing/stats.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/stats.pb.cc: src/proto/grpc/testing/stats.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2442,6 +2480,7 @@ ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/test.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/test.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc: protoc_dep_error
else else
$(GENDIR)/src/proto/grpc/testing/test.pb.cc: src/proto/grpc/testing/test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc: src/proto/grpc/testing/test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc
$(E) "[PROTOC] Generating protobuf CC file from $<" $(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
@ -2550,7 +2589,7 @@ install-shared_c: shared_c strip-shared_c install-pkg-config_c
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.3 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.4
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -2559,7 +2598,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -2568,7 +2607,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_cronet.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_cronet.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -2577,7 +2616,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so
endif endif
ifneq ($(SYSTEM),MINGW32) ifneq ($(SYSTEM),MINGW32)
@ -2594,7 +2633,7 @@ install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-con
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
@ -2603,7 +2642,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_cronet.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_cronet.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
@ -2612,7 +2651,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_error_details.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_error_details.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
@ -2621,7 +2660,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_reflection.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_reflection.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
@ -2630,7 +2669,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_unsecure.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_unsecure.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so
endif endif
ifneq ($(SYSTEM),MINGW32) ifneq ($(SYSTEM),MINGW32)
@ -2647,7 +2686,7 @@ install-shared_csharp: shared_csharp strip-shared_csharp
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so
endif endif
ifneq ($(SYSTEM),MINGW32) ifneq ($(SYSTEM),MINGW32)
@ -2812,8 +2851,8 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.3 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.4 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.4
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -2853,15 +2892,10 @@ LIBGRPC_SRC = \
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 \
@ -2998,6 +3032,10 @@ LIBGRPC_SRC = \
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 \
@ -3047,6 +3085,7 @@ LIBGRPC_SRC = \
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/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 \
@ -3083,6 +3122,7 @@ LIBGRPC_SRC = \
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/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 \
PUBLIC_HEADERS_C += \ PUBLIC_HEADERS_C += \
@ -3155,8 +3195,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.4 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -3175,15 +3215,10 @@ LIBGRPC_CRONET_SRC = \
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 \
@ -3323,6 +3358,10 @@ LIBGRPC_CRONET_SRC = \
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/ext/filters/client_channel/channel_connectivity.c \ src/core/ext/filters/client_channel/channel_connectivity.c \
src/core/ext/filters/client_channel/client_channel.c \ src/core/ext/filters/client_channel/client_channel.c \
src/core/ext/filters/client_channel/client_channel_factory.c \ src/core/ext/filters/client_channel/client_channel_factory.c \
@ -3343,6 +3382,7 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/client_channel/uri_parser.c \
src/core/ext/filters/deadline/deadline_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 \
@ -3445,8 +3485,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(L
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.4 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -3484,15 +3524,10 @@ LIBGRPC_TEST_UTIL_SRC = \
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 \
@ -3717,15 +3752,10 @@ LIBGRPC_UNSECURE_SRC = \
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 \
@ -3863,6 +3893,10 @@ LIBGRPC_UNSECURE_SRC = \
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/ext/transport/chttp2/server/chttp2_server.c \ src/core/ext/transport/chttp2/server/chttp2_server.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 \
@ -3887,6 +3921,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/client_channel/uri_parser.c \
src/core/ext/filters/deadline/deadline_filter.c \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c \ 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_ev_driver_posix.c \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c \
@ -3918,6 +3953,7 @@ LIBGRPC_UNSECURE_SRC = \
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/max_age/max_age_filter.c \
src/core/ext/filters/message_size/message_size_filter.c \
src/core/plugin_registry/grpc_unsecure_plugin_registry.c \ src/core/plugin_registry/grpc_unsecure_plugin_registry.c \
PUBLIC_HEADERS_C += \ PUBLIC_HEADERS_C += \
@ -3978,8 +4014,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.4 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -4112,15 +4148,10 @@ LIBGRPC++_SRC = \
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 \
@ -4310,7 +4341,6 @@ PUBLIC_HEADERS_CXX += \
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 \
@ -4451,15 +4481,10 @@ LIBGRPC++_CRONET_SRC = \
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 \
@ -4602,6 +4627,10 @@ LIBGRPC++_CRONET_SRC = \
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/ext/filters/client_channel/channel_connectivity.c \ src/core/ext/filters/client_channel/channel_connectivity.c \
src/core/ext/filters/client_channel/client_channel.c \ src/core/ext/filters/client_channel/client_channel.c \
src/core/ext/filters/client_channel/client_channel_factory.c \ src/core/ext/filters/client_channel/client_channel_factory.c \
@ -4622,6 +4651,7 @@ LIBGRPC++_CRONET_SRC = \
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/client_channel/uri_parser.c \
src/core/ext/filters/deadline/deadline_filter.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/server/chttp2_server.c \ src/core/ext/transport/chttp2/server/chttp2_server.c \
@ -4711,7 +4741,6 @@ PUBLIC_HEADERS_CXX += \
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 \
@ -5094,7 +5123,6 @@ PUBLIC_HEADERS_CXX += \
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 \
@ -5214,15 +5242,10 @@ LIBGRPC++_UNSECURE_SRC = \
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 \
@ -5412,7 +5435,6 @@ PUBLIC_HEADERS_CXX += \
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 \
@ -9410,6 +9432,38 @@ endif
endif endif
FAKE_RESOLVER_TEST_SRC = \
test/core/client_channel/resolvers/fake_resolver_test.c \
FAKE_RESOLVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FAKE_RESOLVER_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/fake_resolver_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/fake_resolver_test: $(FAKE_RESOLVER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(FAKE_RESOLVER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/fake_resolver_test
endif
$(OBJDIR)/$(CONFIG)/test/core/client_channel/resolvers/fake_resolver_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_fake_resolver_test: $(FAKE_RESOLVER_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(FAKE_RESOLVER_TEST_OBJS:.o=.dep)
endif
endif
FD_CONSERVATION_POSIX_TEST_SRC = \ FD_CONSERVATION_POSIX_TEST_SRC = \
test/core/iomgr/fd_conservation_posix_test.c \ test/core/iomgr/fd_conservation_posix_test.c \
@ -11618,6 +11672,38 @@ endif
endif endif
MINIMAL_STACK_IS_MINIMAL_TEST_SRC = \
test/core/channel/minimal_stack_is_minimal_test.c \
MINIMAL_STACK_IS_MINIMAL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MINIMAL_STACK_IS_MINIMAL_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test: $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test
endif
$(OBJDIR)/$(CONFIG)/test/core/channel/minimal_stack_is_minimal_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_minimal_stack_is_minimal_test: $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS:.o=.dep)
endif
endif
MLOG_TEST_SRC = \ MLOG_TEST_SRC = \
test/core/census/mlog_test.c \ test/core/census/mlog_test.c \
@ -12290,6 +12376,38 @@ endif
endif endif
SLICE_HASH_TABLE_TEST_SRC = \
test/core/slice/slice_hash_table_test.c \
SLICE_HASH_TABLE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SLICE_HASH_TABLE_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/slice_hash_table_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/slice_hash_table_test: $(SLICE_HASH_TABLE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(SLICE_HASH_TABLE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/slice_hash_table_test
endif
$(OBJDIR)/$(CONFIG)/test/core/slice/slice_hash_table_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_slice_hash_table_test: $(SLICE_HASH_TABLE_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(SLICE_HASH_TABLE_TEST_OBJS:.o=.dep)
endif
endif
SLICE_STRING_HELPERS_TEST_SRC = \ SLICE_STRING_HELPERS_TEST_SRC = \
test/core/slice/slice_string_helpers_test.c \ test/core/slice/slice_string_helpers_test.c \
@ -14138,28 +14256,28 @@ $(BINDIR)/$(CONFIG)/codegen_test_minimal: protobuf_dep_error
else else
$(BINDIR)/$(CONFIG)/codegen_test_minimal: $(PROTOBUF_DEP) $(CODEGEN_TEST_MINIMAL_OBJS) $(BINDIR)/$(CONFIG)/codegen_test_minimal: $(PROTOBUF_DEP) $(CODEGEN_TEST_MINIMAL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(CODEGEN_TEST_MINIMAL_OBJS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/codegen_test_minimal $(Q) $(LDXX) $(LDFLAGS) $(CODEGEN_TEST_MINIMAL_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/codegen_test_minimal
endif endif
endif endif
$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/control.o: $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/control.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/messages.o: $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/messages.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/payloads.o: $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/payloads.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/services.o: $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/services.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/stats.o: $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/stats.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/codegen/codegen_test_minimal.o: $(OBJDIR)/$(CONFIG)/test/cpp/codegen/codegen_test_minimal.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/src/cpp/codegen/codegen_init.o: $(OBJDIR)/$(CONFIG)/src/cpp/codegen/codegen_init.o: $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_codegen_test_minimal: $(CODEGEN_TEST_MINIMAL_OBJS:.o=.dep) deps_codegen_test_minimal: $(CODEGEN_TEST_MINIMAL_OBJS:.o=.dep)

@ -21,7 +21,7 @@ See [Performance dashboard](http://performance-dot-grpc-testing.appspot.com/expl
# 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.
@ -36,10 +36,9 @@ Libraries in different languages may be in different states of development. We a
| 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.

@ -15,17 +15,17 @@ 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( bind(
@ -48,9 +48,8 @@ bind(
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",
) )
@ -61,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",
) )

@ -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, well_known_protos, use_external = False, **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.
@ -14,9 +14,10 @@ def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, use_externa
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 well_known_protos: The target from protobuf library that exports well
known protos. Currently it will only work if the value is known protos. Currently it will only work if the value is
"@submodule_protobuf//:well_known_protos" "@com_google_protobuf//:well_known_protos"
use_external: When True the grpc deps are prefixed with //external. This use_external: When True the grpc deps are prefixed with //external. This
allows grpc to be used as a dependency in other bazel projects. 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:
@ -54,6 +55,7 @@ def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, use_externa
srcs = [proto_target], srcs = [proto_target],
plugin = plugin, plugin = plugin,
well_known_protos = well_known_protos, well_known_protos = well_known_protos,
generate_mock = generate_mock,
**kwargs **kwargs
) )

@ -12,6 +12,8 @@ def generate_cc_impl(ctx):
if ctx.executable.plugin: if ctx.executable.plugin:
outs += [proto.basename[:-len(".proto")] + ".grpc.pb.h" for proto in protos] outs += [proto.basename[:-len(".proto")] + ".grpc.pb.h" for proto in protos]
outs += [proto.basename[:-len(".proto")] + ".grpc.pb.cc" for proto in protos] outs += [proto.basename[:-len(".proto")] + ".grpc.pb.cc" for proto in protos]
if ctx.attr.generate_mock:
outs += [proto.basename[:-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.basename[:-len(".proto")] + ".pb.h" for proto in protos]
outs += [proto.basename[:-len(".proto")] + ".pb.cc" for proto in protos] outs += [proto.basename[:-len(".proto")] + ".pb.cc" for proto in protos]
@ -23,7 +25,10 @@ def generate_cc_impl(ctx):
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]
@ -35,10 +40,10 @@ def generate_cc_impl(ctx):
well_known_proto_files = [] well_known_proto_files = []
if ctx.attr.well_known_protos: if ctx.attr.well_known_protos:
f = ctx.attr.well_known_protos.files.to_list()[0].dirname f = ctx.attr.well_known_protos.files.to_list()[0].dirname
if f != "external/submodule_protobuf/src/google/protobuf": if f != "external/com_google_protobuf/src/google/protobuf":
print("Error: Only @submodule_protobuf//:well_known_protos is supported") print("Error: Only @com_google_protobuf//:well_known_protos is supported")
else: else:
# f points to "external/submodule_protobuf/src/google/protobuf" # 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. # add -I argument to protoc so it knows where to look for the proto files.
arguments += ["-I{0}".format(f + "/../..")] arguments += ["-I{0}".format(f + "/../..")]
well_known_proto_files = [f for f in ctx.attr.well_known_protos.files] well_known_proto_files = [f for f in ctx.attr.well_known_protos.files]
@ -71,6 +76,10 @@ generate_cc = rule(
"well_known_protos" : attr.label( "well_known_protos" : attr.label(
mandatory = False, 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,
@ -59,7 +75,7 @@ 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_protos = None, def grpc_proto_library(name, srcs = [], deps = [], well_known_protos = None,
has_services = True, use_external = False): has_services = True, use_external = False, generate_mock = False):
cc_grpc_library( cc_grpc_library(
name = name, name = name,
srcs = srcs, srcs = srcs,
@ -67,5 +83,6 @@ def grpc_proto_library(name, srcs = [], deps = [], well_known_protos = None,
well_known_protos = well_known_protos, well_known_protos = well_known_protos,
proto_only = not has_services, proto_only = not has_services,
use_external = use_external, use_external = use_external,
generate_mock = generate_mock,
) )

@ -666,15 +666,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',
@ -811,6 +806,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',
@ -860,6 +859,7 @@
'src/core/ext/filters/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel.c',
'src/core/ext/filters/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/subchannel_index.c',
'src/core/ext/filters/client_channel/uri_parser.c', 'src/core/ext/filters/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',
@ -896,6 +896,7 @@
'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/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": [

@ -12,9 +12,9 @@ settings:
'#08': Use "-preN" suffixes to identify pre-release versions '#08': Use "-preN" suffixes to identify pre-release versions
'#09': Per-language overrides are possible with (eg) ruby_version tag here '#09': Per-language overrides are possible with (eg) ruby_version tag here
'#10': See the expand_version.py for all the quirks here '#10': See the expand_version.py for all the quirks here
core_version: 3.0.0-pre1 core_version: 4.0.0-dev
g_stands_for: gentle g_stands_for: gentle
version: 1.3.0-pre1 version: 1.4.0-dev
filegroups: filegroups:
- name: census - name: census
public_headers: public_headers:
@ -176,16 +176,11 @@ filegroups:
- 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
@ -288,15 +283,10 @@ filegroups:
- 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 +448,7 @@ filegroups:
plugin: grpc_client_channel plugin: grpc_client_channel
uses: uses:
- grpc_base - grpc_base
- grpc_deadline_filter
- name: grpc_codegen - name: grpc_codegen
public_headers: public_headers:
- include/grpc/impl/codegen/byte_buffer_reader.h - include/grpc/impl/codegen/byte_buffer_reader.h
@ -470,6 +461,27 @@ filegroups:
- include/grpc/impl/codegen/status.h - include/grpc/impl/codegen/status.h
uses: uses:
- gpr_codegen - gpr_codegen
- name: grpc_deadline_filter
headers:
- src/core/ext/filters/deadline/deadline_filter.h
src:
- src/core/ext/filters/deadline/deadline_filter.c
plugin: grpc_deadline_filter
uses:
- grpc_base
- name: grpc_http_filters
headers:
- 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:
- 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
plugin: grpc_http_filters
uses:
- grpc_base
- name: grpc_lb_policy_grpclb - name: grpc_lb_policy_grpclb
headers: headers:
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
@ -535,6 +547,14 @@ filegroups:
plugin: grpc_max_age_filter plugin: grpc_max_age_filter
uses: uses:
- grpc_base - grpc_base
- name: grpc_message_size_filter
headers:
- src/core/ext/filters/message_size/message_size_filter.h
src:
- src/core/ext/filters/message_size/message_size_filter.c
plugin: grpc_message_size_filter
uses:
- grpc_base
- name: grpc_resolver_dns_ares - name: grpc_resolver_dns_ares
headers: headers:
- 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_ev_driver.h
@ -698,6 +718,7 @@ filegroups:
uses: uses:
- grpc_base - grpc_base
- grpc_transport_chttp2_alpn - grpc_transport_chttp2_alpn
- grpc_http_filters
- name: grpc_transport_chttp2_alpn - name: grpc_transport_chttp2_alpn
headers: headers:
- src/core/ext/transport/chttp2/alpn/alpn.h - src/core/ext/transport/chttp2/alpn/alpn.h
@ -771,6 +792,7 @@ filegroups:
filegroups: filegroups:
- grpc_base - grpc_base
- grpc_transport_chttp2 - grpc_transport_chttp2
- grpc_http_filters
- name: nanopb - name: nanopb
headers: headers:
- third_party/nanopb/pb.h - third_party/nanopb/pb.h
@ -917,7 +939,6 @@ filegroups:
- 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
@ -948,6 +969,7 @@ filegroups:
- name: grpc++_test - name: grpc++_test
language: c++ language: c++
public_headers: public_headers:
- include/grpc++/test/mock_stream.h
- include/grpc++/test/server_context_test_spouse.h - include/grpc++/test/server_context_test_spouse.h
deps: deps:
- grpc++ - grpc++
@ -1001,6 +1023,8 @@ libs:
- grpc_secure - grpc_secure
- census - census
- grpc_max_age_filter - grpc_max_age_filter
- grpc_message_size_filter
- grpc_deadline_filter
generate_plugin_registry: true generate_plugin_registry: true
secure: true secure: true
vs_packages: vs_packages:
@ -1098,6 +1122,8 @@ libs:
- grpc_lb_policy_round_robin - grpc_lb_policy_round_robin
- census - census
- grpc_max_age_filter - grpc_max_age_filter
- grpc_message_size_filter
- grpc_deadline_filter
generate_plugin_registry: true generate_plugin_registry: true
secure: false secure: false
vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}' vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}'
@ -1491,6 +1517,7 @@ libs:
- global - global
targets: targets:
- name: alarm_test - name: alarm_test
cpu_cost: 0.1
build: test build: test
language: c language: c
src: src:
@ -1674,7 +1701,7 @@ targets:
dict: test/core/end2end/fuzzers/hpack.dictionary dict: test/core/end2end/fuzzers/hpack.dictionary
maxlen: 2048 maxlen: 2048
- name: combiner_test - name: combiner_test
cpu_cost: 30 cpu_cost: 10
build: test build: test
language: c language: c
src: src:
@ -1695,6 +1722,7 @@ targets:
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: concurrent_connectivity_test - name: concurrent_connectivity_test
cpu_cost: 2.0
build: test build: test
language: c language: c
src: src:
@ -1781,6 +1809,7 @@ targets:
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: ev_epoll_linux_test - name: ev_epoll_linux_test
cpu_cost: 3
build: test build: test
language: c language: c
src: src:
@ -1794,6 +1823,16 @@ targets:
- uv - uv
platforms: platforms:
- linux - linux
- name: fake_resolver_test
build: test
language: c
src:
- test/core/client_channel/resolvers/fake_resolver_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: fd_conservation_posix_test - name: fd_conservation_posix_test
build: test build: test
language: c language: c
@ -1940,6 +1979,7 @@ targets:
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: gpr_cpu_test - name: gpr_cpu_test
cpu_cost: 30
build: test build: test
language: c language: c
src: src:
@ -1989,7 +2029,7 @@ targets:
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: gpr_spinlock_test - name: gpr_spinlock_test
cpu_cost: 10 cpu_cost: 3
build: test build: test
language: c language: c
src: src:
@ -2520,6 +2560,16 @@ targets:
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: minimal_stack_is_minimal_test
build: test
language: c
src:
- test/core/channel/minimal_stack_is_minimal_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: mlog_test - name: mlog_test
flaky: true flaky: true
build: test build: test
@ -2761,6 +2811,16 @@ targets:
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: slice_hash_table_test
build: test
language: c
src:
- test/core/slice/slice_hash_table_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: slice_string_helpers_test - name: slice_string_helpers_test
build: test build: test
language: c language: c
@ -3510,6 +3570,9 @@ targets:
- src/proto/grpc/testing/services.proto - src/proto/grpc/testing/services.proto
- src/proto/grpc/testing/stats.proto - src/proto/grpc/testing/stats.proto
- test/cpp/codegen/codegen_test_minimal.cc - test/cpp/codegen/codegen_test_minimal.cc
deps:
- grpc
- gpr
filegroups: filegroups:
- grpc++_codegen_base - grpc++_codegen_base
- grpc++_codegen_base_src - grpc++_codegen_base_src
@ -3629,7 +3692,7 @@ targets:
- grpc - grpc
- gpr - gpr
args: args:
- --generated_file_path=gens/src/proto/grpc/testing/compiler_test.grpc.pb.h - --generated_file_path=gens/src/proto/grpc/testing/
- name: grpc_cli - name: grpc_cli
build: test build: test
run: false run: false
@ -3890,6 +3953,8 @@ targets:
gtest: true gtest: true
build: test build: test
language: c++ language: c++
headers:
- include/grpc++/test/mock_stream.h
src: src:
- test/cpp/end2end/mock_test.cc - test/cpp/end2end/mock_test.cc
deps: deps:
@ -4332,6 +4397,10 @@ configs:
basicprof: basicprof:
CPPFLAGS: -O2 -DGRPC_BASIC_PROFILER -DGRPC_TIMERS_RDTSC CPPFLAGS: -O2 -DGRPC_BASIC_PROFILER -DGRPC_TIMERS_RDTSC
DEFINES: NDEBUG DEFINES: NDEBUG
c++-compat:
CFLAGS: -Wc++-compat
CPPFLAGS: -O0
DEFINES: _DEBUG DEBUG
counters: counters:
CPPFLAGS: -O2 -DGPR_LOW_LEVEL_COUNTERS CPPFLAGS: -O2 -DGPR_LOW_LEVEL_COUNTERS
DEFINES: NDEBUG DEFINES: NDEBUG
@ -4398,7 +4467,7 @@ configs:
CPPFLAGS: -O0 -fsanitize-coverage=edge -fsanitize=undefined -fno-omit-frame-pointer CPPFLAGS: -O0 -fsanitize-coverage=edge -fsanitize=undefined -fno-omit-frame-pointer
-Wno-unused-command-line-argument -Wvarargs -Wno-unused-command-line-argument -Wvarargs
CXX: clang++ CXX: clang++
DEFINES: NDEBUG DEFINES: NDEBUG GRPC_UBSAN
LD: clang LD: clang
LDFLAGS: -fsanitize=undefined,unsigned-integer-overflow LDFLAGS: -fsanitize=undefined,unsigned-integer-overflow
LDXX: clang++ LDXX: clang++

@ -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

@ -91,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 \
@ -236,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 \
@ -285,6 +284,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/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 \
@ -321,6 +321,7 @@ if test "$PHP_GRPC" != "no"; then
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/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 \
@ -693,8 +694,14 @@ if test "$PHP_GRPC" != "no"; then
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/filters/client_channel/resolver/dns/c_ares)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/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/filters/client_channel/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/load_reporting)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/max_age) 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)

@ -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

@ -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
@ -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.

@ -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

@ -1,5 +0,0 @@
{
"sdk": {
"version": "1.0.0-preview2-003131"
}
}

@ -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,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.

@ -1,4 +1,4 @@
#Errors and Cancelletion code samples for grpc-ruby # Errors and Cancelletion code samples for grpc-ruby
The examples in this directory show use of grpc errors. The examples in this directory show use of grpc errors.

@ -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.3.0-pre1' 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'
@ -258,16 +258,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',
@ -386,6 +381,9 @@ Pod::Spec.new do |s|
'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',
@ -429,6 +427,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/subchannel.h', 'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/filters/client_channel/subchannel_index.h', 'src/core/ext/filters/client_channel/subchannel_index.h',
'src/core/ext/filters/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/filters/client_channel/lb_policy/grpclb/grpclb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
@ -459,19 +458,15 @@ Pod::Spec.new do |s|
'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/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',
@ -608,6 +603,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',
@ -657,6 +656,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel.c',
'src/core/ext/filters/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/subchannel_index.c',
'src/core/ext/filters/client_channel/uri_parser.c', 'src/core/ext/filters/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',
@ -693,6 +693,7 @@ Pod::Spec.new do |s|
'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/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',
@ -712,16 +713,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',
@ -840,6 +836,9 @@ Pod::Spec.new do |s|
'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',
@ -883,6 +882,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/subchannel.h', 'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/filters/client_channel/subchannel_index.h', 'src/core/ext/filters/client_channel/subchannel_index.h',
'src/core/ext/filters/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/filters/client_channel/lb_policy/grpclb/grpclb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
@ -912,7 +912,8 @@ 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/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|

@ -36,7 +36,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC' s.name = 'gRPC-ProtoRPC'
version = '1.3.0-pre1' 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'

@ -36,7 +36,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary' s.name = 'gRPC-RxLibrary'
version = '1.3.0-pre1' 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'

@ -35,7 +35,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC' s.name = 'gRPC'
version = '1.3.0-pre1' 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'

@ -70,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
@ -82,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

@ -174,16 +174,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 )
@ -302,6 +297,9 @@ Gem::Specification.new do |s|
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 )
@ -345,6 +343,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/subchannel.h ) s.files += %w( src/core/ext/filters/client_channel/subchannel.h )
s.files += %w( src/core/ext/filters/client_channel/subchannel_index.h ) s.files += %w( src/core/ext/filters/client_channel/subchannel_index.h )
s.files += %w( src/core/ext/filters/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/filters/client_channel/lb_policy/grpclb/grpclb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h )
@ -375,19 +374,15 @@ Gem::Specification.new do |s|
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/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 )
@ -524,6 +519,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 )
@ -573,6 +572,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/subchannel.c ) s.files += %w( src/core/ext/filters/client_channel/subchannel.c )
s.files += %w( src/core/ext/filters/client_channel/subchannel_index.c ) s.files += %w( src/core/ext/filters/client_channel/subchannel_index.c )
s.files += %w( src/core/ext/filters/client_channel/uri_parser.c ) s.files += %w( src/core/ext/filters/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 )
@ -609,6 +609,7 @@ Gem::Specification.new do |s|
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/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 )

@ -145,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 {
@ -185,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>
@ -210,23 +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(
// if corked bit is set in context, we buffer up the initial metadata to call.call(), sizeof(ClientAsyncWriter)))
// coalesce with later message to be sent. No op is performed. ClientAsyncWriter(call, context, response, tag);
if (context_->initial_metadata_corked_) { }
write_ops_.SendInitialMetadata(context->send_initial_metadata_,
context->initial_metadata_flags()); // always allocated against a call arena, no memory free required
} else { static void operator delete(void* ptr, std::size_t size) {
write_ops_.set_output_tag(tag); assert(size == sizeof(ClientAsyncWriter));
write_ops_.SendInitialMetadata(context->send_initial_metadata_,
context->initial_metadata_flags());
call_.PerformOps(&write_ops_);
}
} }
void ReadInitialMetadata(void* tag) override { void ReadInitialMetadata(void* tag) override {
@ -271,6 +282,24 @@ 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<CallOpRecvInitialMetadata> meta_ops_; CallOpSet<CallOpRecvInitialMetadata> meta_ops_;
@ -298,21 +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) {
if (context_->initial_metadata_corked_) { Call call = channel->CreateCall(method, context, cq);
// 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. return new (g_core_codegen_interface->grpc_call_arena_alloc(
write_ops_.SendInitialMetadata(context->send_initial_metadata_, call.call(), sizeof(ClientAsyncReaderWriter)))
context->initial_metadata_flags()); ClientAsyncReaderWriter(call, context, tag);
} else { }
write_ops_.set_output_tag(tag);
write_ops_.SendInitialMetadata(context->send_initial_metadata_, // always allocated against a call arena, no memory free required
context->initial_metadata_flags()); static void operator delete(void* ptr, std::size_t size) {
call_.PerformOps(&write_ops_); assert(size == sizeof(ClientAsyncReaderWriter));
}
} }
void ReadInitialMetadata(void* tag) override { void ReadInitialMetadata(void* tag) override {
@ -366,6 +394,21 @@ 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<CallOpRecvInitialMetadata> meta_ops_; CallOpSet<CallOpRecvInitialMetadata> meta_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>
@ -246,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;
@ -468,7 +471,7 @@ class CallOpServerSendStatus {
trailing_metadata_ = FillMetadataArray( trailing_metadata_ = FillMetadataArray(
trailing_metadata, &trailing_metadata_count_, send_error_details_); 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_error_message_ = status.error_message(); send_error_message_ = status.error_message();
} }
@ -579,17 +582,6 @@ class CallOpClientRecvStatus {
grpc_slice error_message_; 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
@ -597,18 +589,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.
@ -629,13 +612,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 {
@ -646,7 +631,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;
} }
@ -654,6 +639,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.

@ -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,

@ -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,10 @@ 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_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;

@ -40,6 +40,7 @@
#include <grpc/impl/codegen/compression_types.h> #include <grpc/impl/codegen/compression_types.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>
@ -211,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;

@ -1,47 +0,0 @@
/*
*
* Copyright 2016, 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.
*
*/
#ifndef GRPCXX_IMPL_CODEGEN_STATUS_HELPER_H
#define GRPCXX_IMPL_CODEGEN_STATUS_HELPER_H
#include <grpc++/impl/codegen/status.h>
namespace grpc {
inline StatusCode GetCanonicalCode(const Status& status) {
return status.error_code();
}
} // namespace grpc
#endif // GRPCXX_IMPL_CODEGEN_STATUS_HELPER_H

@ -155,7 +155,11 @@ class ClientReader final : public ClientReaderInterface<R> {
template <class W> template <class W>
ClientReader(ChannelInterface* channel, const RpcMethod& method, ClientReader(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, const W& request) ClientContext* context, const W& request)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) { : context_(context),
cq_(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
GRPC_CQ_DEFAULT_POLLING}), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> CallOpClientSendClose>
ops; ops;
@ -227,7 +231,11 @@ class ClientWriter : public ClientWriterInterface<W> {
template <class R> template <class R>
ClientWriter(ChannelInterface* channel, const RpcMethod& method, ClientWriter(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, R* response) ClientContext* context, R* response)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) { : context_(context),
cq_(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
GRPC_CQ_DEFAULT_POLLING}), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
finish_ops_.RecvMessage(response); finish_ops_.RecvMessage(response);
finish_ops_.AllowNoMessage(); finish_ops_.AllowNoMessage();
@ -325,7 +333,11 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
/// Blocking create a stream. /// Blocking create a stream.
ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method, ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context) ClientContext* context)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) { : context_(context),
cq_(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK,
GRPC_CQ_DEFAULT_POLLING}), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
if (!context_->initial_metadata_corked_) { if (!context_->initial_metadata_corked_) {
CallOpSet<CallOpSendInitialMetadata> ops; CallOpSet<CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(context->send_initial_metadata_, ops.SendInitialMetadata(context->send_initial_metadata_,
@ -562,7 +574,7 @@ class ServerReaderWriterBody final {
Call* const call_; Call* const call_;
ServerContext* const ctx_; ServerContext* const ctx_;
}; };
} } // namespace internal
// class to represent the user API for a bidirectional streaming call // class to represent the user API for a bidirectional streaming call
template <class W, class R> template <class W, class R>

@ -89,7 +89,8 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen {
/// Called before server is started. /// Called before server is started.
virtual void PreServerStart(Server* server) {} virtual void PreServerStart(Server* server) {}
/// Called after a server port is added. /// Called after a server port is added.
virtual void AddPort(Server* server, int port) {} virtual void AddPort(Server* server, const grpc::string& addr,
ServerCredentials* creds, int port) {}
}; };
/// Set the global callback object. Can only be called once. Does not take /// Set the global callback object. Can only be called once. Does not take
/// ownership of callbacks, and expects the pointed to object to be alive /// ownership of callbacks, and expects the pointed to object to be alive
@ -177,9 +178,7 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen {
/// 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.
/// void Start(ServerCompletionQueue** cqs, size_t num_cqs) override;
/// \return true on a successful shutdown.
bool Start(ServerCompletionQueue** cqs, size_t num_cqs) override;
void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) override; void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) override;

@ -195,10 +195,7 @@ class ServerBuilder {
struct SyncServerSettings { struct SyncServerSettings {
SyncServerSettings() SyncServerSettings()
: num_cqs(1), : num_cqs(1), min_pollers(1), max_pollers(2), cq_timeout_msec(10000) {}
min_pollers(1),
max_pollers(INT_MAX),
cq_timeout_msec(1000) {}
// Number of server completion queues to create to listen to incoming RPCs. // Number of server completion queues to create to listen to incoming RPCs.
int num_cqs; int num_cqs;

@ -0,0 +1,163 @@
/*
*
* Copyright 2017, 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.
*
*/
#ifndef GRPCXX_TEST_MOCK_STREAM_H
#define GRPCXX_TEST_MOCK_STREAM_H
#include <stdint.h>
#include <gmock/gmock.h>
#include <grpc++/impl/codegen/call.h>
#include <grpc++/support/async_stream.h>
#include <grpc++/support/async_unary_call.h>
#include <grpc++/support/sync_stream.h>
namespace grpc {
namespace testing {
template <class R>
class MockClientReader : public ClientReaderInterface<R> {
public:
MockClientReader() = default;
// ClientStreamingInterface
MOCK_METHOD0_T(Finish, Status());
// ReaderInterface
MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
MOCK_METHOD1_T(Read, bool(R*));
// ClientReaderInterface
MOCK_METHOD0_T(WaitForInitialMetadata, void());
};
template <class W>
class MockClientWriter : public ClientWriterInterface<W> {
public:
MockClientWriter() = default;
// ClientStreamingInterface
MOCK_METHOD0_T(Finish, Status());
// WriterInterface
MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
// ClientWriterInterface
MOCK_METHOD0_T(WritesDone, bool());
};
template <class W, class R>
class MockClientReaderWriter : public ClientReaderWriterInterface<W, R> {
public:
MockClientReaderWriter() = default;
// ClientStreamingInterface
MOCK_METHOD0_T(Finish, Status());
// ReaderInterface
MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
MOCK_METHOD1_T(Read, bool(R*));
// WriterInterface
MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
// ClientReaderWriterInterface
MOCK_METHOD0_T(WaitForInitialMetadata, void());
MOCK_METHOD0_T(WritesDone, bool());
};
// TODO: We do not support mocking an async RPC for now.
template <class R>
class MockClientAsyncResponseReader
: public ClientAsyncResponseReaderInterface<R> {
public:
MockClientAsyncResponseReader() = default;
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD3_T(Finish, void(R*, Status*, void*));
};
template <class R>
class MockClientAsyncReader : public ClientAsyncReaderInterface<R> {
public:
MockClientAsyncReader() = default;
// ClientAsyncStreamingInterface
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD2_T(Finish, void(Status*, void*));
// AsyncReaderInterface
MOCK_METHOD2_T(Read, void(R*, void*));
};
template <class W>
class MockClientAsyncWriter : public ClientAsyncWriterInterface<W> {
public:
MockClientAsyncWriter() = default;
// ClientAsyncStreamingInterface
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD2_T(Finish, void(Status*, void*));
// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
// ClientAsyncWriterInterface
MOCK_METHOD1_T(WritesDone, void(void*));
};
template <class W, class R>
class MockClientAsyncReaderWriter
: public ClientAsyncReaderWriterInterface<W, R> {
public:
MockClientAsyncReaderWriter() = default;
// ClientAsyncStreamingInterface
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD2_T(Finish, void(Status*, void*));
// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
// AsyncReaderInterface
MOCK_METHOD2_T(Read, void(R*, void*));
// ClientAsyncReaderWriterInterface
MOCK_METHOD1_T(WritesDone, void(void*));
};
} // namespace testing
} // namespace grpc
#endif // GRPCXX_TEST_MOCK_STREAM_H

@ -93,55 +93,6 @@ GRPCAPI const char *grpc_version_string(void);
/** Return a string specifying what the 'g' in gRPC stands for */ /** Return a string specifying what the 'g' in gRPC stands for */
GRPCAPI const char *grpc_g_stands_for(void); GRPCAPI const char *grpc_g_stands_for(void);
/** Specifies the type of APIs to use to pop events from the completion queue */
typedef enum {
/* Events are popped out by calling grpc_completion_queue_next() API ONLY */
GRPC_CQ_NEXT = 1,
/* Events are popped out by calling grpc_completion_queue_pluck() API ONLY */
GRPC_CQ_PLUCK
} grpc_cq_completion_type;
/** Completion queues internally MAY maintain a set of file descriptors in a
structure called 'pollset'. This enum specifies if a completion queue has an
associated pollset and any restrictions on the type of file descriptors that
can be present in the pollset.
I/O progress can only be made when grpc_completion_queue_next() or
grpc_completion_queue_pluck() are called on the completion queue (unless the
grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important
to actively call these APIs */
typedef enum {
/** The completion queue will have an associated pollset and there is no
restriction on the type of file descriptors the pollset may contain */
GRPC_CQ_DEFAULT_POLLING,
/* Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will
not contain any 'listening file descriptors' (i.e file descriptors used to
listen to incoming channels) */
GRPC_CQ_NON_LISTENING,
/* The completion queue will not have an associated pollset. Note that
grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still be
called to pop events from the completion queue; it is not required to call
them actively to make I/O progress */
GRPC_CQ_NON_POLLING
} grpc_cq_polling_type;
#define GRPC_CQ_CURRENT_VERSION 1
typedef struct grpc_completion_queue_attributes {
/* The version number of this structure. More fields might be added to this
structure in future. */
int version; /* Set to GRPC_CQ_CURRENT_VERSION */
grpc_cq_completion_type cq_completion_type;
grpc_cq_polling_type cq_polling_type;
} grpc_completion_queue_attributes;
/** The completion queue factory structure is opaque to the callers of grpc */
typedef struct grpc_completion_queue_factory grpc_completion_queue_factory;
/** Returns the completion queue factory based on the attributes. MAY return a /** Returns the completion queue factory based on the attributes. MAY return a
NULL if no factory can be found */ NULL if no factory can be found */
GRPCAPI const grpc_completion_queue_factory * GRPCAPI const grpc_completion_queue_factory *
@ -159,7 +110,9 @@ GRPCAPI grpc_completion_queue *grpc_completion_queue_create_for_pluck(
void *reserved); void *reserved);
/** Create a completion queue */ /** Create a completion queue */
GRPCAPI grpc_completion_queue *grpc_completion_queue_create(void *reserved); GRPCAPI grpc_completion_queue *grpc_completion_queue_create(
const grpc_completion_queue_factory *factory,
const grpc_completion_queue_attributes *attributes, void *reserved);
/** Blocks until an event is available, the completion queue is being shut down, /** Blocks until an event is available, the completion queue is being shut down,
or deadline is reached. or deadline is reached.
@ -263,6 +216,10 @@ GRPCAPI grpc_call *grpc_channel_create_registered_call(
grpc_completion_queue *completion_queue, void *registered_call_handle, grpc_completion_queue *completion_queue, void *registered_call_handle,
gpr_timespec deadline, void *reserved); gpr_timespec deadline, void *reserved);
/** Allocate memory in the grpc_call arena: this memory is automatically
discarded at call completion */
GRPCAPI void *grpc_call_arena_alloc(grpc_call *call, size_t size);
/** Start a batch of operations defined in the array ops; when complete, post a /** Start a batch of operations defined in the array ops; when complete, post a
completion of type 'tag' to the completion queue bound to the call. completion of type 'tag' to the completion queue bound to the call.
The order of ops specified in the batch has no significance. The order of ops specified in the batch has no significance.
@ -294,12 +251,6 @@ GRPCAPI grpc_call_error grpc_call_start_batch(grpc_call *call,
functionality. Instead, use grpc_auth_context. */ functionality. Instead, use grpc_auth_context. */
GRPCAPI char *grpc_call_get_peer(grpc_call *call); GRPCAPI char *grpc_call_get_peer(grpc_call *call);
struct grpc_load_reporting_cost_context;
/* Associate costs contained in \a cost_context to \a call. */
GRPCAPI void grpc_call_set_load_reporting_cost_context(
grpc_call *call, struct grpc_load_reporting_cost_context *context);
struct census_context; struct census_context;
/** Set census context for a call; Must be called before first call to /** Set census context for a call; Must be called before first call to
@ -345,7 +296,7 @@ GRPCAPI void grpc_channel_destroy(grpc_channel *channel);
/** Called by clients to cancel an RPC on the server. /** Called by clients to cancel an RPC on the server.
Can be called multiple times, from any thread. Can be called multiple times, from any thread.
THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status
are thread-safe, and can be called at any point before grpc_call_destroy are thread-safe, and can be called at any point before grpc_call_unref
is called.*/ is called.*/
GRPCAPI grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved); GRPCAPI grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved);
@ -360,9 +311,13 @@ GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call *call,
const char *description, const char *description,
void *reserved); void *reserved);
/** Destroy a call. /** Ref a call.
THREAD SAFETY: grpc_call_destroy is thread-compatible */ THREAD SAFETY: grpc_call_unref is thread-compatible */
GRPCAPI void grpc_call_destroy(grpc_call *call); GRPCAPI void grpc_call_ref(grpc_call *call);
/** Unref a call.
THREAD SAFETY: grpc_call_unref is thread-compatible */
GRPCAPI void grpc_call_unref(grpc_call *call);
/** Request notification of a new call. /** Request notification of a new call.
Once a call is received, a notification tagged with \a tag_new is added to Once a call is received, a notification tagged with \a tag_new is added to
@ -423,15 +378,6 @@ GRPCAPI void grpc_server_register_completion_queue(grpc_server *server,
grpc_completion_queue *cq, grpc_completion_queue *cq,
void *reserved); void *reserved);
/** Register a non-listening completion queue with the server. This API is
similar to grpc_server_register_completion_queue except that the server will
not use this completion_queue to listen to any incoming channels.
Registering a non-listening completion queue will have negative performance
impact and hence this API is not recommended for production use cases. */
GRPCAPI void grpc_server_register_non_listening_completion_queue(
grpc_server *server, grpc_completion_queue *q, void *reserved);
/** Add a HTTP2 over plaintext over tcp listener. /** Add a HTTP2 over plaintext over tcp listener.
Returns bound port number on success, 0 on failure. Returns bound port number on success, 0 on failure.
REQUIRES: server not started */ REQUIRES: server not started */

@ -175,6 +175,12 @@ typedef struct {
/** Grace period after the chennel reaches its max age. Int valued, /** Grace period after the chennel reaches its max age. Int valued,
milliseconds. INT_MAX means unlimited. */ milliseconds. INT_MAX means unlimited. */
#define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms" #define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms"
/** Enable/disable support for per-message compression. Defaults to 1, unless
GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0. */
#define GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION "grpc.per_message_compression"
/** Enable/disable support for deadline checking. Defaults to 1, unless
GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0 */
#define GRPC_ARG_ENABLE_DEADLINE_CHECKS "grpc.enable_deadline_checking"
/** Initial sequence number for http2 transports. Int valued. */ /** Initial sequence number for http2 transports. Int valued. */
#define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \ #define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \
"grpc.http2.initial_sequence_number" "grpc.http2.initial_sequence_number"
@ -199,6 +205,8 @@ typedef struct {
/** Minimum time (in milliseconds) between successive ping frames being sent */ /** Minimum time (in milliseconds) between successive ping frames being sent */
#define GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS \ #define GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS \
"grpc.http2.min_time_between_pings_ms" "grpc.http2.min_time_between_pings_ms"
/* Channel arg to override the http2 :scheme header */
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
/** How many pings can we send before needing to send a data frame or header /** How many pings can we send before needing to send a data frame or header
frame? frame?
(0 indicates that an infinite number of pings can be sent without sending (0 indicates that an infinite number of pings can be sent without sending
@ -240,6 +248,8 @@ typedef struct {
/** Secondary user agent: goes at the end of the user-agent metadata /** Secondary user agent: goes at the end of the user-agent metadata
sent on each request. A string. */ sent on each request. A string. */
#define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent" #define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent"
/** The minimum time between subsequent connection attempts, in ms */
#define GRPC_ARG_MIN_RECONNECT_BACKOFF_MS "grpc.min_reconnect_backoff_ms"
/** The maximum time between subsequent connection attempts, in ms */ /** The maximum time between subsequent connection attempts, in ms */
#define GRPC_ARG_MAX_RECONNECT_BACKOFF_MS "grpc.max_reconnect_backoff_ms" #define GRPC_ARG_MAX_RECONNECT_BACKOFF_MS "grpc.max_reconnect_backoff_ms"
/** The time between the first and second connection attempts, in ms */ /** The time between the first and second connection attempts, in ms */
@ -393,8 +403,11 @@ typedef enum grpc_completion_type {
typedef struct grpc_event { typedef struct grpc_event {
/** The type of the completion. */ /** The type of the completion. */
grpc_completion_type type; grpc_completion_type type;
/** non-zero if the operation was successful, 0 upon failure. /** If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates
Only GRPC_OP_COMPLETE can succeed or fail. */ whether the operation was successful or not; 0 in case of failure and
non-zero in case of success.
If grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this
field is guaranteed to be 0 */
int success; int success;
/** The tag passed to grpc_call_start_batch etc to start this operation. /** The tag passed to grpc_call_start_batch etc to start this operation.
Only GRPC_OP_COMPLETE has a tag. */ Only GRPC_OP_COMPLETE has a tag. */
@ -543,6 +556,55 @@ typedef struct {
typedef struct grpc_resource_quota grpc_resource_quota; typedef struct grpc_resource_quota grpc_resource_quota;
/** Completion queues internally MAY maintain a set of file descriptors in a
structure called 'pollset'. This enum specifies if a completion queue has an
associated pollset and any restrictions on the type of file descriptors that
can be present in the pollset.
I/O progress can only be made when grpc_completion_queue_next() or
grpc_completion_queue_pluck() are called on the completion queue (unless the
grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important
to actively call these APIs */
typedef enum {
/** The completion queue will have an associated pollset and there is no
restriction on the type of file descriptors the pollset may contain */
GRPC_CQ_DEFAULT_POLLING,
/** Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will
not contain any 'listening file descriptors' (i.e file descriptors used to
listen to incoming channels) */
GRPC_CQ_NON_LISTENING,
/** The completion queue will not have an associated pollset. Note that
grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still
be called to pop events from the completion queue; it is not required to
call them actively to make I/O progress */
GRPC_CQ_NON_POLLING
} grpc_cq_polling_type;
/** Specifies the type of APIs to use to pop events from the completion queue */
typedef enum {
/** Events are popped out by calling grpc_completion_queue_next() API ONLY */
GRPC_CQ_NEXT = 1,
/** Events are popped out by calling grpc_completion_queue_pluck() API ONLY*/
GRPC_CQ_PLUCK
} grpc_cq_completion_type;
#define GRPC_CQ_CURRENT_VERSION 1
typedef struct grpc_completion_queue_attributes {
/* The version number of this structure. More fields might be added to this
structure in future. */
int version; /* Set to GRPC_CQ_CURRENT_VERSION */
grpc_cq_completion_type cq_completion_type;
grpc_cq_polling_type cq_polling_type;
} grpc_completion_queue_attributes;
/** The completion queue factory structure is opaque to the callers of grpc */
typedef struct grpc_completion_queue_factory grpc_completion_queue_factory;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -35,7 +35,6 @@
#define GRPC_LOAD_REPORTING_H #define GRPC_LOAD_REPORTING_H
#include <grpc/impl/codegen/port_platform.h> #include <grpc/impl/codegen/port_platform.h>
#include <grpc/slice.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -50,11 +49,12 @@ extern "C" {
* gRPC LB system. */ * gRPC LB system. */
#define GRPC_LB_TOKEN_MD_KEY "lb-token" #define GRPC_LB_TOKEN_MD_KEY "lb-token"
/** A sequence of values for load reporting purposes */ /** Metadata key for gRPC LB cost reporting.
typedef struct grpc_load_reporting_cost_context { *
grpc_slice *values; * The value corresponding to this key is an opaque binary blob reported by the
size_t values_count; * backend as part of its trailing metadata containing cost information for the
} grpc_load_reporting_cost_context; * call. */
#define GRPC_LB_COST_MD_KEY "lb-cost-bin"
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -102,9 +102,9 @@ GPRAPI grpc_slice grpc_slice_from_static_string(const char *source);
/* Create a slice pointing to constant memory */ /* Create a slice pointing to constant memory */
GPRAPI grpc_slice grpc_slice_from_static_buffer(const void *source, size_t len); GPRAPI grpc_slice grpc_slice_from_static_buffer(const void *source, size_t len);
/* Return a result slice derived from s, which shares a ref count with s, where /* Return a result slice derived from s, which shares a ref count with \a s,
result.data==s.data+begin, and result.length==end-begin. where result.data==s.data+begin, and result.length==end-begin. The ref count
The ref count of s is increased by one. of \a s is increased by one. Do not assign result back to \a s.
Requires s initialized, begin <= end, begin <= s.length, and Requires s initialized, begin <= end, begin <= s.length, and
end <= source->length. */ end <= source->length. */
GPRAPI grpc_slice grpc_slice_sub(grpc_slice s, size_t begin, size_t end); GPRAPI grpc_slice grpc_slice_sub(grpc_slice s, size_t begin, size_t end);

@ -1,6 +1,6 @@
{ {
"name": "grpc", "name": "grpc",
"version": "1.3.0-pre1", "version": "1.4.0-dev",
"author": "Google Inc.", "author": "Google Inc.",
"description": "gRPC Library for Node", "description": "gRPC Library for Node",
"homepage": "http://www.grpc.io/", "homepage": "http://www.grpc.io/",

@ -13,8 +13,8 @@
<date>2017-03-01</date> <date>2017-03-01</date>
<time>16:06:07</time> <time>16:06:07</time>
<version> <version>
<release>1.3.0RC1</release> <release>1.4.0dev</release>
<api>1.3.0RC1</api> <api>1.4.0dev</api>
</version> </version>
<stability> <stability>
<release>beta</release> <release>beta</release>
@ -183,16 +183,11 @@
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_args.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_stack.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/compress_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/connected_channel.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/connected_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/context.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/context.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/deadline_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/http_client_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/http_server_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/message_size_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/algorithm_metadata.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/compression/algorithm_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/message_compress.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/compression/message_compress.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/trace.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/debug/trace.h" role="src" />
@ -311,6 +306,9 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/stream_map.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/stream_map.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client/http_client_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/message_compress/message_compress_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/server/http_server_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/context/security_context.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/context/security_context.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/credentials.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/credentials/credentials.h" role="src" />
@ -354,6 +352,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_index.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_index.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/uri_parser.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/uri_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h" role="src" />
@ -384,19 +383,15 @@
<file baseinstalldir="/" name="src/core/ext/census/trace_string.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/trace_string.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/tracing.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/tracing.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/init.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/surface/init.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_args.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_stack.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/compress_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/connected_channel.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/connected_channel.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/deadline_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/http_client_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/http_server_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/message_size_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/compression.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/compression/compression.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/message_compress.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/compression/message_compress.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/trace.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/debug/trace.c" role="src" />
@ -533,6 +528,10 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/writing.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/writing.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client/http_client_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/http_filters_plugin.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/message_compress/message_compress_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/server/http_server_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/httpcli_security_connector.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/http/httpcli_security_connector.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/context/security_context.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/context/security_context.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.c" role="src" />
@ -582,6 +581,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_index.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_index.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/uri_parser.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/uri_parser.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c" role="src" />
@ -618,6 +618,7 @@
<file baseinstalldir="/" name="src/core/ext/census/trace_context.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/trace_context.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/tracing.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/tracing.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/plugin_registry/grpc_plugin_registry.c" role="src" /> <file baseinstalldir="/" name="src/core/plugin_registry/grpc_plugin_registry.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl/crypto/aes/internal.h" role="src" /> <file baseinstalldir="/" name="third_party/boringssl/crypto/aes/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/asn1_locl.h" role="src" /> <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/asn1_locl.h" role="src" />

@ -1106,8 +1106,8 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer,
"const $Request$& request, " "const $Request$& request, "
"::grpc::CompletionQueue* cq) {\n"); "::grpc::CompletionQueue* cq) {\n");
printer->Print(*vars, printer->Print(*vars,
" return new " " return "
"::grpc::ClientAsyncResponseReader< $Response$>(" "::grpc::ClientAsyncResponseReader< $Response$>::Create("
"channel_.get(), cq, " "channel_.get(), cq, "
"rpcmethod_$Method$_, " "rpcmethod_$Method$_, "
"context, request);\n" "context, request);\n"
@ -1129,7 +1129,7 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer,
"::grpc::ClientContext* context, $Response$* response, " "::grpc::ClientContext* context, $Response$* response, "
"::grpc::CompletionQueue* cq, void* tag) {\n"); "::grpc::CompletionQueue* cq, void* tag) {\n");
printer->Print(*vars, printer->Print(*vars,
" return new ::grpc::ClientAsyncWriter< $Request$>(" " return ::grpc::ClientAsyncWriter< $Request$>::Create("
"channel_.get(), cq, " "channel_.get(), cq, "
"rpcmethod_$Method$_, " "rpcmethod_$Method$_, "
"context, response, tag);\n" "context, response, tag);\n"
@ -1152,7 +1152,7 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer,
"::grpc::ClientContext* context, const $Request$& request, " "::grpc::ClientContext* context, const $Request$& request, "
"::grpc::CompletionQueue* cq, void* tag) {\n"); "::grpc::CompletionQueue* cq, void* tag) {\n");
printer->Print(*vars, printer->Print(*vars,
" return new ::grpc::ClientAsyncReader< $Response$>(" " return ::grpc::ClientAsyncReader< $Response$>::Create("
"channel_.get(), cq, " "channel_.get(), cq, "
"rpcmethod_$Method$_, " "rpcmethod_$Method$_, "
"context, request, tag);\n" "context, request, tag);\n"
@ -1174,13 +1174,14 @@ void PrintSourceClientMethod(grpc_generator::Printer *printer,
"::grpc::ClientAsyncReaderWriter< $Request$, $Response$>* " "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>* "
"$ns$$Service$::Stub::Async$Method$Raw(::grpc::ClientContext* context, " "$ns$$Service$::Stub::Async$Method$Raw(::grpc::ClientContext* context, "
"::grpc::CompletionQueue* cq, void* tag) {\n"); "::grpc::CompletionQueue* cq, void* tag) {\n");
printer->Print(*vars, printer->Print(
" return new " *vars,
"::grpc::ClientAsyncReaderWriter< $Request$, $Response$>(" " return "
"channel_.get(), cq, " "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>::Create("
"rpcmethod_$Method$_, " "channel_.get(), cq, "
"context, tag);\n" "rpcmethod_$Method$_, "
"}\n\n"); "context, tag);\n"
"}\n\n");
} }
} }
@ -1407,4 +1408,180 @@ grpc::string GetSourceEpilogue(grpc_generator::File *file,
return temp; return temp;
} }
// TODO(mmukhi): Make sure we need parameters or not.
grpc::string GetMockPrologue(grpc_generator::File *file,
const Parameters & /*params*/) {
grpc::string output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
std::map<grpc::string, grpc::string> vars;
vars["filename"] = file->filename();
vars["filename_base"] = file->filename_without_ext();
vars["message_header_ext"] = message_header_ext();
vars["service_header_ext"] = service_header_ext();
printer->Print(vars, "// Generated by the gRPC C++ plugin.\n");
printer->Print(vars,
"// If you make any local change, they will be lost.\n");
printer->Print(vars, "// source: $filename$\n\n");
printer->Print(vars, "#include \"$filename_base$$message_header_ext$\"\n");
printer->Print(vars, "#include \"$filename_base$$service_header_ext$\"\n");
printer->Print(vars, file->additional_headers().c_str());
printer->Print(vars, "\n");
}
return output;
}
// TODO(mmukhi): Add client-stream and completion-queue headers.
grpc::string GetMockIncludes(grpc_generator::File *file,
const Parameters &params) {
grpc::string output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
std::map<grpc::string, grpc::string> vars;
static const char *headers_strs[] = {
"grpc++/impl/codegen/async_stream.h",
"grpc++/impl/codegen/sync_stream.h", "gmock/gmock.h",
};
std::vector<grpc::string> headers(headers_strs, array_end(headers_strs));
PrintIncludes(printer.get(), headers, params);
if (!file->package().empty()) {
std::vector<grpc::string> parts = file->package_parts();
for (auto part = parts.begin(); part != parts.end(); part++) {
vars["part"] = *part;
printer->Print(vars, "namespace $part$ {\n");
}
}
printer->Print(vars, "\n");
}
return output;
}
void PrintMockClientMethods(grpc_generator::Printer *printer,
const grpc_generator::Method *method,
std::map<grpc::string, grpc::string> *vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] = method->input_type_name();
(*vars)["Response"] = method->output_type_name();
if (method->NoStreaming()) {
printer->Print(
*vars,
"MOCK_METHOD3($Method$, ::grpc::Status(::grpc::ClientContext* context, "
"const $Request$& request, $Response$* response));\n");
printer->Print(*vars,
"MOCK_METHOD3(Async$Method$Raw, "
"::grpc::ClientAsyncResponseReaderInterface< $Response$>*"
"(::grpc::ClientContext* context, const $Request$& request, "
"::grpc::CompletionQueue* cq));\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(
*vars,
"MOCK_METHOD2($Method$Raw, "
"::grpc::ClientWriterInterface< $Request$>*"
"(::grpc::ClientContext* context, $Response$* response));\n");
printer->Print(*vars,
"MOCK_METHOD4(Async$Method$Raw, "
"::grpc::ClientAsyncWriterInterface< $Request$>*"
"(::grpc::ClientContext* context, $Response$* response, "
"::grpc::CompletionQueue* cq, void* tag));\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
*vars,
"MOCK_METHOD2($Method$Raw, "
"::grpc::ClientReaderInterface< $Response$>*"
"(::grpc::ClientContext* context, const $Request$& request));\n");
printer->Print(*vars,
"MOCK_METHOD4(Async$Method$Raw, "
"::grpc::ClientAsyncReaderInterface< $Response$>*"
"(::grpc::ClientContext* context, const $Request$& request, "
"::grpc::CompletionQueue* cq, void* tag));\n");
} else if (method->BidiStreaming()) {
printer->Print(
*vars,
"MOCK_METHOD1($Method$Raw, "
"::grpc::ClientReaderWriterInterface< $Request$, $Response$>*"
"(::grpc::ClientContext* context));\n");
printer->Print(
*vars,
"MOCK_METHOD3(Async$Method$Raw, "
"::grpc::ClientAsyncReaderWriterInterface<$Request$, $Response$>*"
"(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, "
"void* tag));\n");
}
}
void PrintMockService(grpc_generator::Printer *printer,
const grpc_generator::Service *service,
std::map<grpc::string, grpc::string> *vars) {
(*vars)["Service"] = service->name();
printer->Print(*vars,
"class Mock$Service$Stub : public $Service$::StubInterface {\n"
" public:\n");
printer->Indent();
for (int i = 0; i < service->method_count(); ++i) {
PrintMockClientMethods(printer, service->method(i).get(), vars);
}
printer->Outdent();
printer->Print("};\n");
}
grpc::string GetMockServices(grpc_generator::File *file,
const Parameters &params) {
grpc::string output;
{
// Scope the output stream so it closes and finalizes output to the string.
auto printer = file->CreatePrinter(&output);
std::map<grpc::string, grpc::string> vars;
// Package string is empty or ends with a dot. It is used to fully qualify
// method names.
vars["Package"] = file->package();
if (!file->package().empty()) {
vars["Package"].append(".");
}
if (!params.services_namespace.empty()) {
vars["services_namespace"] = params.services_namespace;
printer->Print(vars, "\nnamespace $services_namespace$ {\n\n");
}
for (int i = 0; i < file->service_count(); i++) {
PrintMockService(printer.get(), file->service(i).get(), &vars);
printer->Print("\n");
}
if (!params.services_namespace.empty()) {
printer->Print(vars, "} // namespace $services_namespace$\n\n");
}
}
return output;
}
grpc::string GetMockEpilogue(grpc_generator::File *file,
const Parameters & /*params*/) {
grpc::string temp;
if (!file->package().empty()) {
std::vector<grpc::string> parts = file->package_parts();
for (auto part = parts.begin(); part != parts.end(); part++) {
temp.append("} // namespace ");
temp.append(*part);
temp.append("\n");
}
temp.append("\n");
}
return temp;
}
} // namespace grpc_cpp_generator } // namespace grpc_cpp_generator

@ -65,6 +65,8 @@ struct Parameters {
bool use_system_headers; bool use_system_headers;
// Prefix to any grpc include // Prefix to any grpc include
grpc::string grpc_search_path; grpc::string grpc_search_path;
// Generate GMOCK code to facilitate unit testing.
bool generate_mock_code;
}; };
// Return the prologue of the generated header file. // Return the prologue of the generated header file.
@ -99,6 +101,38 @@ grpc::string GetSourceServices(grpc_generator::File *file,
grpc::string GetSourceEpilogue(grpc_generator::File *file, grpc::string GetSourceEpilogue(grpc_generator::File *file,
const Parameters &params); const Parameters &params);
// Return the prologue of the generated mock file.
grpc::string GetMockPrologue(grpc_generator::File *file,
const Parameters &params);
// Return the includes needed for generated mock file.
grpc::string GetMockIncludes(grpc_generator::File *file,
const Parameters &params);
// Return the services for generated mock file.
grpc::string GetMockServices(grpc_generator::File *file,
const Parameters &params);
// Return the epilogue of generated mock file.
grpc::string GetMockEpilogue(grpc_generator::File *file,
const Parameters &params);
// Return the prologue of the generated mock file.
grpc::string GetMockPrologue(grpc_generator::File *file,
const Parameters &params);
// Return the includes needed for generated mock file.
grpc::string GetMockIncludes(grpc_generator::File *file,
const Parameters &params);
// Return the services for generated mock file.
grpc::string GetMockServices(grpc_generator::File *file,
const Parameters &params);
// Return the epilogue of generated mock file.
grpc::string GetMockEpilogue(grpc_generator::File *file,
const Parameters &params);
} // namespace grpc_cpp_generator } // namespace grpc_cpp_generator
#endif // GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H #endif // GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H

@ -62,6 +62,7 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
grpc_cpp_generator::Parameters generator_parameters; grpc_cpp_generator::Parameters generator_parameters;
generator_parameters.use_system_headers = true; generator_parameters.use_system_headers = true;
generator_parameters.generate_mock_code = false;
ProtoBufFile pbfile(file); ProtoBufFile pbfile(file);
@ -85,6 +86,13 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
} }
} else if (param[0] == "grpc_search_path") { } else if (param[0] == "grpc_search_path") {
generator_parameters.grpc_search_path = param[1]; generator_parameters.grpc_search_path = param[1];
} else if (param[0] == "generate_mock_code") {
if (param[1] == "true") {
generator_parameters.generate_mock_code = true;
} else if (param[1] != "false") {
*error = grpc::string("Invalid parameter: ") + *parameter_string;
return false;
}
} else { } else {
*error = grpc::string("Unknown parameter: ") + *parameter_string; *error = grpc::string("Unknown parameter: ") + *parameter_string;
return false; return false;
@ -114,6 +122,19 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
grpc::protobuf::io::CodedOutputStream source_coded_out(source_output.get()); grpc::protobuf::io::CodedOutputStream source_coded_out(source_output.get());
source_coded_out.WriteRaw(source_code.data(), source_code.size()); source_coded_out.WriteRaw(source_code.data(), source_code.size());
if (!generator_parameters.generate_mock_code) {
return true;
}
grpc::string mock_code =
grpc_cpp_generator::GetMockPrologue(&pbfile, generator_parameters) +
grpc_cpp_generator::GetMockIncludes(&pbfile, generator_parameters) +
grpc_cpp_generator::GetMockServices(&pbfile, generator_parameters) +
grpc_cpp_generator::GetMockEpilogue(&pbfile, generator_parameters);
std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> mock_output(
context->Open(file_name + "_mock.grpc.pb.h"));
grpc::protobuf::io::CodedOutputStream mock_coded_out(mock_output.get());
mock_coded_out.WriteRaw(mock_code.data(), mock_code.size());
return true; return true;
} }

@ -68,6 +68,7 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
::grpc::string imports = ::grpc::string("#import \"") + file_name + ::grpc::string imports = ::grpc::string("#import \"") + file_name +
".pbobjc.h\"\n\n" ".pbobjc.h\"\n\n"
"#import <ProtoRPC/ProtoService.h>\n" "#import <ProtoRPC/ProtoService.h>\n"
"#import <ProtoRPC/ProtoRPC.h>\n"
"#import <RxLibrary/GRXWriteable.h>\n" "#import <RxLibrary/GRXWriteable.h>\n"
"#import <RxLibrary/GRXWriter.h>\n"; "#import <RxLibrary/GRXWriter.h>\n";

@ -101,6 +101,14 @@ PrivateGenerator::PrivateGenerator(const GeneratorConfiguration& config,
void PrivateGenerator::PrintAllComments(StringVector comments, void PrivateGenerator::PrintAllComments(StringVector comments,
grpc_generator::Printer* out) { grpc_generator::Printer* out) {
if (comments.empty()) { if (comments.empty()) {
// Python requires code structures like class and def to have
// a body, even if it is just "pass" or a docstring. We need
// to ensure not to generate empty bodies. We could do something
// smarter and more sophisticated, but at the moment, if there is
// no docstring to print, we simply emit "pass" to ensure validity
// of the generated code.
out->Print("# missing associated documentation comment in .proto file\n");
out->Print("pass\n");
return; return;
} }
out->Print("\"\"\""); out->Print("\"\"\"");

@ -200,7 +200,7 @@ static bool tag_set_add_tag(struct tag_set *tags, const census_tag *tag,
// allocate new memory if needed // allocate new memory if needed
tags->kvm_size += 2 * CENSUS_MAX_TAG_KV_LEN + TAG_HEADER_SIZE; tags->kvm_size += 2 * CENSUS_MAX_TAG_KV_LEN + TAG_HEADER_SIZE;
char *new_kvm = gpr_malloc(tags->kvm_size); char *new_kvm = gpr_malloc(tags->kvm_size);
memcpy(new_kvm, tags->kvm, tags->kvm_used); if (tags->kvm_used > 0) memcpy(new_kvm, tags->kvm, tags->kvm_used);
gpr_free(tags->kvm); gpr_free(tags->kvm);
tags->kvm = new_kvm; tags->kvm = new_kvm;
} }

@ -223,7 +223,9 @@ size_t allocate_resource(void) {
if (n_resources == n_defined_resources) { if (n_resources == n_defined_resources) {
size_t new_n_resources = n_resources ? n_resources * 2 : 2; size_t new_n_resources = n_resources ? n_resources * 2 : 2;
resource **new_resources = gpr_malloc(new_n_resources * sizeof(resource *)); resource **new_resources = gpr_malloc(new_n_resources * sizeof(resource *));
memcpy(new_resources, resources, n_resources * sizeof(resource *)); if (n_resources != 0) {
memcpy(new_resources, resources, n_resources * sizeof(resource *));
}
memset(new_resources + n_resources, 0, memset(new_resources + n_resources, 0,
(new_n_resources - n_resources) * sizeof(resource *)); (new_n_resources - n_resources) * sizeof(resource *));
gpr_free(resources); gpr_free(resources);

@ -49,9 +49,9 @@
#include "src/core/ext/filters/client_channel/resolver_registry.h" #include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/filters/client_channel/retry_throttle.h" #include "src/core/ext/filters/client_channel/retry_throttle.h"
#include "src/core/ext/filters/client_channel/subchannel.h" #include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/filters/deadline/deadline_filter.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/deadline_filter.h"
#include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/iomgr/polling_entity.h"
@ -96,17 +96,10 @@ static void method_parameters_unref(method_parameters *method_params) {
} }
} }
static void *method_parameters_copy(void *value) {
return method_parameters_ref(value);
}
static void method_parameters_free(grpc_exec_ctx *exec_ctx, void *value) { static void method_parameters_free(grpc_exec_ctx *exec_ctx, void *value) {
method_parameters_unref(value); method_parameters_unref(value);
} }
static const grpc_slice_hash_table_vtable method_parameters_vtable = {
method_parameters_free, method_parameters_copy};
static bool parse_wait_for_ready(grpc_json *field, static bool parse_wait_for_ready(grpc_json *field,
wait_for_ready_value *wait_for_ready) { wait_for_ready_value *wait_for_ready) {
if (field->type != GRPC_JSON_TRUE && field->type != GRPC_JSON_FALSE) { if (field->type != GRPC_JSON_TRUE && field->type != GRPC_JSON_FALSE) {
@ -183,6 +176,8 @@ typedef struct client_channel_channel_data {
grpc_resolver *resolver; grpc_resolver *resolver;
/** have we started resolving this channel */ /** have we started resolving this channel */
bool started_resolving; bool started_resolving;
/** is deadline checking enabled? */
bool deadline_checking_enabled;
/** client channel factory */ /** client channel factory */
grpc_client_channel_factory *client_channel_factory; grpc_client_channel_factory *client_channel_factory;
@ -236,14 +231,23 @@ static void set_channel_connectivity_state_locked(grpc_exec_ctx *exec_ctx,
grpc_connectivity_state state, grpc_connectivity_state state,
grpc_error *error, grpc_error *error,
const char *reason) { const char *reason) {
if ((state == GRPC_CHANNEL_TRANSIENT_FAILURE || /* TODO: Improve failure handling:
state == GRPC_CHANNEL_SHUTDOWN) && * - Make it possible for policies to return GRPC_CHANNEL_TRANSIENT_FAILURE.
chand->lb_policy != NULL) { * - Hand over pending picks from old policies during the switch that happens
/* cancel picks with wait_for_ready=false */ * when resolver provides an update. */
grpc_lb_policy_cancel_picks_locked( if (chand->lb_policy != NULL) {
exec_ctx, chand->lb_policy, if (state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
/* mask= */ GRPC_INITIAL_METADATA_WAIT_FOR_READY, /* cancel picks with wait_for_ready=false */
/* check= */ 0, GRPC_ERROR_REF(error)); grpc_lb_policy_cancel_picks_locked(
exec_ctx, chand->lb_policy,
/* mask= */ GRPC_INITIAL_METADATA_WAIT_FOR_READY,
/* check= */ 0, GRPC_ERROR_REF(error));
} else if (state == GRPC_CHANNEL_SHUTDOWN) {
/* cancel all picks */
grpc_lb_policy_cancel_picks_locked(exec_ctx, chand->lb_policy,
/* mask= */ 0, /* check= */ 0,
GRPC_ERROR_REF(error));
}
} }
grpc_connectivity_state_set(exec_ctx, &chand->state_tracker, state, error, grpc_connectivity_state_set(exec_ctx, &chand->state_tracker, state, error,
reason); reason);
@ -346,6 +350,33 @@ static void parse_retry_throttle_params(const grpc_json *field, void *arg) {
} }
} }
// Wrap a closure associated with \a lb_policy. The associated callback (\a
// wrapped_on_pick_closure_cb) is responsible for unref'ing \a lb_policy after
// scheduling \a wrapped_closure.
typedef struct wrapped_on_pick_closure_arg {
/* the closure instance using this struct as argument */
grpc_closure wrapper_closure;
/* the original closure. Usually a on_complete/notify cb for pick() and ping()
* calls against the internal RR instance, respectively. */
grpc_closure *wrapped_closure;
/* The policy instance related to the closure */
grpc_lb_policy *lb_policy;
} wrapped_on_pick_closure_arg;
// Invoke \a arg->wrapped_closure, unref \a arg->lb_policy and free \a arg.
static void wrapped_on_pick_closure_cb(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
wrapped_on_pick_closure_arg *wc_arg = arg;
GPR_ASSERT(wc_arg != NULL);
GPR_ASSERT(wc_arg->wrapped_closure != NULL);
GPR_ASSERT(wc_arg->lb_policy != NULL);
grpc_closure_run(exec_ctx, wc_arg->wrapped_closure, GRPC_ERROR_REF(error));
GRPC_LB_POLICY_UNREF(exec_ctx, wc_arg->lb_policy, "pick_subchannel_wrapping");
gpr_free(wc_arg);
}
static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx, static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx,
void *arg, grpc_error *error) { void *arg, grpc_error *error) {
channel_data *chand = arg; channel_data *chand = arg;
@ -369,26 +400,24 @@ static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx,
GPR_ASSERT(channel_arg->type == GRPC_ARG_STRING); GPR_ASSERT(channel_arg->type == GRPC_ARG_STRING);
lb_policy_name = channel_arg->value.string; lb_policy_name = channel_arg->value.string;
} }
// Special case: If all of the addresses are balancer addresses, // Special case: If at least one balancer address is present, we use
// assume that we should use the grpclb policy, regardless of what the // the grpclb policy, regardless of what the resolver actually specified.
// resolver actually specified.
channel_arg = channel_arg =
grpc_channel_args_find(chand->resolver_result, GRPC_ARG_LB_ADDRESSES); grpc_channel_args_find(chand->resolver_result, GRPC_ARG_LB_ADDRESSES);
if (channel_arg != NULL && channel_arg->type == GRPC_ARG_POINTER) { if (channel_arg != NULL && channel_arg->type == GRPC_ARG_POINTER) {
grpc_lb_addresses *addresses = channel_arg->value.pointer.p; grpc_lb_addresses *addresses = channel_arg->value.pointer.p;
bool found_backend_address = false; bool found_balancer_address = false;
for (size_t i = 0; i < addresses->num_addresses; ++i) { for (size_t i = 0; i < addresses->num_addresses; ++i) {
if (!addresses->addresses[i].is_balancer) { if (addresses->addresses[i].is_balancer) {
found_backend_address = true; found_balancer_address = true;
break; break;
} }
} }
if (!found_backend_address) { if (found_balancer_address) {
if (lb_policy_name != NULL && strcmp(lb_policy_name, "grpclb") != 0) { if (lb_policy_name != NULL && strcmp(lb_policy_name, "grpclb") != 0) {
gpr_log(GPR_INFO, gpr_log(GPR_INFO,
"resolver requested LB policy %s but provided only balancer " "resolver requested LB policy %s but provided at least one "
"addresses, no backend addresses -- forcing use of grpclb LB " "balancer address -- forcing use of grpclb LB policy",
"policy",
lb_policy_name); lb_policy_name);
} }
lb_policy_name = "grpclb"; lb_policy_name = "grpclb";
@ -434,7 +463,7 @@ static void on_resolver_result_changed_locked(grpc_exec_ctx *exec_ctx,
grpc_uri_destroy(uri); grpc_uri_destroy(uri);
method_params_table = grpc_service_config_create_method_config_table( method_params_table = grpc_service_config_create_method_config_table(
exec_ctx, service_config, method_parameters_create_from_json, exec_ctx, service_config, method_parameters_create_from_json,
&method_parameters_vtable); method_parameters_free);
grpc_service_config_destroy(service_config); grpc_service_config_destroy(service_config);
} }
} }
@ -676,6 +705,8 @@ static grpc_error *cc_init_channel_elem(grpc_exec_ctx *exec_ctx,
if (chand->resolver == NULL) { if (chand->resolver == NULL) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("resolver creation failed"); return GRPC_ERROR_CREATE_FROM_STATIC_STRING("resolver creation failed");
} }
chand->deadline_checking_enabled =
grpc_deadline_checking_enabled(args->channel_args);
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
} }
@ -864,12 +895,14 @@ static void apply_final_configuration_locked(grpc_exec_ctx *exec_ctx,
/* apply service-config level configuration to the call (now that we're /* apply service-config level configuration to the call (now that we're
* certain it exists) */ * certain it exists) */
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data;
gpr_timespec per_method_deadline; gpr_timespec per_method_deadline;
if (set_call_method_params_from_service_config_locked(exec_ctx, elem, if (set_call_method_params_from_service_config_locked(exec_ctx, elem,
&per_method_deadline)) { &per_method_deadline)) {
// If the deadline from the service config is shorter than the one // If the deadline from the service config is shorter than the one
// from the client API, reset the deadline timer. // from the client API, reset the deadline timer.
if (gpr_time_cmp(per_method_deadline, calld->deadline) < 0) { if (chand->deadline_checking_enabled &&
gpr_time_cmp(per_method_deadline, calld->deadline) < 0) {
calld->deadline = per_method_deadline; calld->deadline = per_method_deadline;
grpc_deadline_state_reset(exec_ctx, elem, calld->deadline); grpc_deadline_state_reset(exec_ctx, elem, calld->deadline);
} }
@ -1031,11 +1064,29 @@ static bool pick_subchannel_locked(
const grpc_lb_policy_pick_args inputs = { const grpc_lb_policy_pick_args inputs = {
initial_metadata, initial_metadata_flags, &calld->lb_token_mdelem, initial_metadata, initial_metadata_flags, &calld->lb_token_mdelem,
gpr_inf_future(GPR_CLOCK_MONOTONIC)}; gpr_inf_future(GPR_CLOCK_MONOTONIC)};
const bool result = grpc_lb_policy_pick_locked(
exec_ctx, lb_policy, &inputs, connected_subchannel, NULL, on_ready); // Wrap the user-provided callback in order to hold a strong reference to
// the LB policy for the duration of the pick.
wrapped_on_pick_closure_arg *w_on_pick_arg =
gpr_zalloc(sizeof(*w_on_pick_arg));
grpc_closure_init(&w_on_pick_arg->wrapper_closure,
wrapped_on_pick_closure_cb, w_on_pick_arg,
grpc_schedule_on_exec_ctx);
w_on_pick_arg->wrapped_closure = on_ready;
GRPC_LB_POLICY_REF(lb_policy, "pick_subchannel_wrapping");
w_on_pick_arg->lb_policy = lb_policy;
const bool pick_done = grpc_lb_policy_pick_locked(
exec_ctx, lb_policy, &inputs, connected_subchannel, NULL,
&w_on_pick_arg->wrapper_closure);
if (pick_done) {
/* synchronous grpc_lb_policy_pick call. Unref the LB policy. */
GRPC_LB_POLICY_UNREF(exec_ctx, w_on_pick_arg->lb_policy,
"pick_subchannel_wrapping");
gpr_free(w_on_pick_arg);
}
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "pick_subchannel"); GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "pick_subchannel");
GPR_TIMER_END("pick_subchannel", 0); GPR_TIMER_END("pick_subchannel", 0);
return result; return pick_done;
} }
if (chand->resolver != NULL && !chand->started_resolving) { if (chand->resolver != NULL && !chand->started_resolving) {
chand->started_resolving = true; chand->started_resolving = true;
@ -1227,8 +1278,10 @@ static void cc_start_transport_stream_op_batch(
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;
GRPC_CALL_LOG_OP(GPR_INFO, elem, op); GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem, if (chand->deadline_checking_enabled) {
op); grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem,
op);
}
/* try to (atomically) get the call */ /* try to (atomically) get the call */
grpc_subchannel_call *call = GET_CALL(calld); grpc_subchannel_call *call = GET_CALL(calld);
GPR_TIMER_BEGIN("cc_start_transport_stream_op_batch", 0); GPR_TIMER_BEGIN("cc_start_transport_stream_op_batch", 0);
@ -1262,14 +1315,16 @@ static grpc_error *cc_init_call_elem(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem, grpc_call_element *elem,
const grpc_call_element_args *args) { const grpc_call_element_args *args) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data;
// Initialize data members. // Initialize data members.
grpc_deadline_state_init(exec_ctx, elem, args->call_stack);
calld->path = grpc_slice_ref_internal(args->path); calld->path = grpc_slice_ref_internal(args->path);
calld->call_start_time = args->start_time; calld->call_start_time = args->start_time;
calld->deadline = gpr_convert_clock_type(args->deadline, GPR_CLOCK_MONOTONIC); calld->deadline = gpr_convert_clock_type(args->deadline, GPR_CLOCK_MONOTONIC);
calld->owning_call = args->call_stack; calld->owning_call = args->call_stack;
calld->arena = args->arena; calld->arena = args->arena;
grpc_deadline_state_start(exec_ctx, elem, calld->deadline); if (chand->deadline_checking_enabled) {
grpc_deadline_state_init(exec_ctx, elem, args->call_stack, calld->deadline);
}
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
} }
@ -1279,7 +1334,10 @@ static void cc_destroy_call_elem(grpc_exec_ctx *exec_ctx,
const grpc_call_final_info *final_info, const grpc_call_final_info *final_info,
grpc_closure *then_schedule_closure) { grpc_closure *then_schedule_closure) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
grpc_deadline_state_destroy(exec_ctx, elem); channel_data *chand = elem->channel_data;
if (chand->deadline_checking_enabled) {
grpc_deadline_state_destroy(exec_ctx, elem);
}
grpc_slice_unref_internal(exec_ctx, calld->path); grpc_slice_unref_internal(exec_ctx, calld->path);
if (calld->method_params != NULL) { if (calld->method_params != NULL) {
method_parameters_unref(calld->method_params); method_parameters_unref(calld->method_params);

@ -91,8 +91,9 @@ void grpc_client_channel_init(void) {
grpc_subchannel_index_init(); grpc_subchannel_index_init();
grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MIN, grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MIN,
set_default_host_if_unset, NULL); set_default_host_if_unset, NULL);
grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX, append_filter, grpc_channel_init_register_stage(
(void *)&grpc_client_channel_filter); GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, append_filter,
(void *)&grpc_client_channel_filter);
grpc_http_connect_register_handshaker_factory(); grpc_http_connect_register_handshaker_factory();
} }

@ -750,18 +750,11 @@ static void destroy_balancer_name(grpc_exec_ctx *exec_ctx,
gpr_free(balancer_name); gpr_free(balancer_name);
} }
static void *copy_balancer_name(void *balancer_name) {
return gpr_strdup(balancer_name);
}
static grpc_slice_hash_table_entry targets_info_entry_create( static grpc_slice_hash_table_entry targets_info_entry_create(
const char *address, const char *balancer_name) { const char *address, const char *balancer_name) {
static const grpc_slice_hash_table_vtable vtable = {destroy_balancer_name,
copy_balancer_name};
grpc_slice_hash_table_entry entry; grpc_slice_hash_table_entry entry;
entry.key = grpc_slice_from_copied_string(address); entry.key = grpc_slice_from_copied_string(address);
entry.value = (void *)balancer_name; entry.value = gpr_strdup(balancer_name);
entry.vtable = &vtable;
return entry; return entry;
} }
@ -825,11 +818,8 @@ static char *get_lb_uri_target_addresses(grpc_exec_ctx *exec_ctx,
uri_path); uri_path);
gpr_free(uri_path); gpr_free(uri_path);
*targets_info = *targets_info = grpc_slice_hash_table_create(
grpc_slice_hash_table_create(num_grpclb_addrs, targets_info_entries); num_grpclb_addrs, targets_info_entries, destroy_balancer_name);
for (size_t i = 0; i < num_grpclb_addrs; i++) {
grpc_slice_unref_internal(exec_ctx, targets_info_entries[i].key);
}
gpr_free(targets_info_entries); gpr_free(targets_info_entries);
return target_uri_str; return target_uri_str;
@ -841,10 +831,10 @@ static grpc_lb_policy *glb_create(grpc_exec_ctx *exec_ctx,
/* Count the number of gRPC-LB addresses. There must be at least one. /* Count the number of gRPC-LB addresses. There must be at least one.
* TODO(roth): For now, we ignore non-balancer addresses, but in the * TODO(roth): For now, we ignore non-balancer addresses, but in the
* future, we may change the behavior such that we fall back to using * future, we may change the behavior such that we fall back to using
* the non-balancer addresses if we cannot reach any balancers. At that * the non-balancer addresses if we cannot reach any balancers. In the
* time, this should be changed to allow a list with no balancer addresses, * fallback case, we should use the LB policy indicated by
* since the resolver might fail to return a balancer address even when * GRPC_ARG_LB_POLICY_NAME (although if that specifies grpclb or is
* this is the right LB policy to use. */ * unset, we should default to pick_first). */
const grpc_arg *arg = const grpc_arg *arg =
grpc_channel_args_find(args->args, GRPC_ARG_LB_ADDRESSES); grpc_channel_args_find(args->args, GRPC_ARG_LB_ADDRESSES);
if (arg == NULL || arg->type != GRPC_ARG_POINTER) { if (arg == NULL || arg->type != GRPC_ARG_POINTER) {
@ -1122,6 +1112,7 @@ static void lb_call_init_locked(grpc_exec_ctx *exec_ctx,
glb_policy->base.interested_parties, glb_policy->base.interested_parties,
GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD, GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD,
&host, glb_policy->deadline, NULL); &host, glb_policy->deadline, NULL);
grpc_slice_unref_internal(exec_ctx, host);
grpc_metadata_array_init(&glb_policy->lb_initial_metadata_recv); grpc_metadata_array_init(&glb_policy->lb_initial_metadata_recv);
grpc_metadata_array_init(&glb_policy->lb_trailing_metadata_recv); grpc_metadata_array_init(&glb_policy->lb_trailing_metadata_recv);
@ -1152,7 +1143,7 @@ static void lb_call_init_locked(grpc_exec_ctx *exec_ctx,
static void lb_call_destroy_locked(grpc_exec_ctx *exec_ctx, static void lb_call_destroy_locked(grpc_exec_ctx *exec_ctx,
glb_lb_policy *glb_policy) { glb_lb_policy *glb_policy) {
GPR_ASSERT(glb_policy->lb_call != NULL); GPR_ASSERT(glb_policy->lb_call != NULL);
grpc_call_destroy(glb_policy->lb_call); grpc_call_unref(glb_policy->lb_call);
glb_policy->lb_call = NULL; glb_policy->lb_call = NULL;
grpc_metadata_array_destroy(&glb_policy->lb_initial_metadata_recv); grpc_metadata_array_destroy(&glb_policy->lb_initial_metadata_recv);
@ -1293,6 +1284,7 @@ static void lb_on_response_received_locked(grpc_exec_ctx *exec_ctx, void *arg,
"Received empty server list. Picks will stay pending until a " "Received empty server list. Picks will stay pending until a "
"response with > 0 servers is received"); "response with > 0 servers is received");
} }
grpc_grpclb_destroy_serverlist(glb_policy->serverlist);
} }
} else { /* serverlist == NULL */ } else { /* serverlist == NULL */
gpr_log(GPR_ERROR, "Invalid LB response received: '%s'. Ignoring.", gpr_log(GPR_ERROR, "Invalid LB response received: '%s'. Ignoring.",

@ -16,6 +16,12 @@ const pb_field_t grpc_lb_v1_Duration_fields[3] = {
PB_LAST_FIELD PB_LAST_FIELD
}; };
const pb_field_t grpc_lb_v1_Timestamp_fields[3] = {
PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v1_Timestamp, seconds, seconds, 0),
PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Timestamp, nanos, seconds, 0),
PB_LAST_FIELD
};
const pb_field_t grpc_lb_v1_LoadBalanceRequest_fields[3] = { const pb_field_t grpc_lb_v1_LoadBalanceRequest_fields[3] = {
PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v1_InitialLoadBalanceRequest_fields), PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v1_InitialLoadBalanceRequest_fields),
PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v1_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v1_ClientStats_fields), PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, grpc_lb_v1_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v1_ClientStats_fields),
@ -27,10 +33,14 @@ const pb_field_t grpc_lb_v1_InitialLoadBalanceRequest_fields[2] = {
PB_LAST_FIELD PB_LAST_FIELD
}; };
const pb_field_t grpc_lb_v1_ClientStats_fields[4] = { const pb_field_t grpc_lb_v1_ClientStats_fields[8] = {
PB_FIELD( 1, INT64 , OPTIONAL, STATIC , FIRST, grpc_lb_v1_ClientStats, total_requests, total_requests, 0), PB_FIELD( 1, MESSAGE , OPTIONAL, STATIC , FIRST, grpc_lb_v1_ClientStats, timestamp, timestamp, &grpc_lb_v1_Timestamp_fields),
PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, client_rpc_errors, total_requests, 0), PB_FIELD( 2, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_started, timestamp, 0),
PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, dropped_requests, client_rpc_errors, 0), PB_FIELD( 3, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished, num_calls_started, 0),
PB_FIELD( 4, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_with_drop_for_rate_limiting, num_calls_finished, 0),
PB_FIELD( 5, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_with_drop_for_load_balancing, num_calls_finished_with_drop_for_rate_limiting, 0),
PB_FIELD( 6, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_with_client_failed_to_send, num_calls_finished_with_drop_for_load_balancing, 0),
PB_FIELD( 7, INT64 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_ClientStats, num_calls_finished_known_received, num_calls_finished_with_client_failed_to_send, 0),
PB_LAST_FIELD PB_LAST_FIELD
}; };
@ -52,11 +62,12 @@ const pb_field_t grpc_lb_v1_ServerList_fields[3] = {
PB_LAST_FIELD PB_LAST_FIELD
}; };
const pb_field_t grpc_lb_v1_Server_fields[5] = { const pb_field_t grpc_lb_v1_Server_fields[6] = {
PB_FIELD( 1, BYTES , OPTIONAL, STATIC , FIRST, grpc_lb_v1_Server, ip_address, ip_address, 0), PB_FIELD( 1, BYTES , OPTIONAL, STATIC , FIRST, grpc_lb_v1_Server, ip_address, ip_address, 0),
PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, port, ip_address, 0), PB_FIELD( 2, INT32 , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, port, ip_address, 0),
PB_FIELD( 3, STRING , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, load_balance_token, port, 0), PB_FIELD( 3, STRING , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, load_balance_token, port, 0),
PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, drop_request, load_balance_token, 0), PB_FIELD( 4, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, drop_for_rate_limiting, load_balance_token, 0),
PB_FIELD( 5, BOOL , OPTIONAL, STATIC , OTHER, grpc_lb_v1_Server, drop_for_load_balancing, drop_for_rate_limiting, 0),
PB_LAST_FIELD PB_LAST_FIELD
}; };
@ -70,7 +81,7 @@ const pb_field_t grpc_lb_v1_Server_fields[5] = {
* numbers or field sizes that are larger than what can fit in 8 or 16 bit * numbers or field sizes that are larger than what can fit in 8 or 16 bit
* field descriptors. * field descriptors.
*/ */
PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v1_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server) PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v1_ClientStats, timestamp) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v1_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_Timestamp_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server)
#endif #endif
#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
@ -81,7 +92,7 @@ PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request)
* numbers or field sizes that are larger than what can fit in the default * numbers or field sizes that are larger than what can fit in the default
* 8 bit descriptors. * 8 bit descriptors.
*/ */
PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v1_ServerList, servers) < 256 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server) PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v1_ClientStats, timestamp) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v1_ServerList, servers) < 256 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_Timestamp_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server)
#endif #endif

@ -14,16 +14,6 @@ extern "C" {
#endif #endif
/* Struct definitions */ /* Struct definitions */
typedef struct _grpc_lb_v1_ClientStats {
bool has_total_requests;
int64_t total_requests;
bool has_client_rpc_errors;
int64_t client_rpc_errors;
bool has_dropped_requests;
int64_t dropped_requests;
/* @@protoc_insertion_point(struct:grpc_lb_v1_ClientStats) */
} grpc_lb_v1_ClientStats;
typedef struct _grpc_lb_v1_Duration { typedef struct _grpc_lb_v1_Duration {
bool has_seconds; bool has_seconds;
int64_t seconds; int64_t seconds;
@ -46,11 +36,39 @@ typedef struct _grpc_lb_v1_Server {
int32_t port; int32_t port;
bool has_load_balance_token; bool has_load_balance_token;
char load_balance_token[50]; char load_balance_token[50];
bool has_drop_request; bool has_drop_for_rate_limiting;
bool drop_request; bool drop_for_rate_limiting;
bool has_drop_for_load_balancing;
bool drop_for_load_balancing;
/* @@protoc_insertion_point(struct:grpc_lb_v1_Server) */ /* @@protoc_insertion_point(struct:grpc_lb_v1_Server) */
} grpc_lb_v1_Server; } grpc_lb_v1_Server;
typedef struct _grpc_lb_v1_Timestamp {
bool has_seconds;
int64_t seconds;
bool has_nanos;
int32_t nanos;
/* @@protoc_insertion_point(struct:grpc_lb_v1_Timestamp) */
} grpc_lb_v1_Timestamp;
typedef struct _grpc_lb_v1_ClientStats {
bool has_timestamp;
grpc_lb_v1_Timestamp timestamp;
bool has_num_calls_started;
int64_t num_calls_started;
bool has_num_calls_finished;
int64_t num_calls_finished;
bool has_num_calls_finished_with_drop_for_rate_limiting;
int64_t num_calls_finished_with_drop_for_rate_limiting;
bool has_num_calls_finished_with_drop_for_load_balancing;
int64_t num_calls_finished_with_drop_for_load_balancing;
bool has_num_calls_finished_with_client_failed_to_send;
int64_t num_calls_finished_with_client_failed_to_send;
bool has_num_calls_finished_known_received;
int64_t num_calls_finished_known_received;
/* @@protoc_insertion_point(struct:grpc_lb_v1_ClientStats) */
} grpc_lb_v1_ClientStats;
typedef struct _grpc_lb_v1_InitialLoadBalanceResponse { typedef struct _grpc_lb_v1_InitialLoadBalanceResponse {
bool has_load_balancer_delegate; bool has_load_balancer_delegate;
char load_balancer_delegate[64]; char load_balancer_delegate[64];
@ -59,6 +77,13 @@ typedef struct _grpc_lb_v1_InitialLoadBalanceResponse {
/* @@protoc_insertion_point(struct:grpc_lb_v1_InitialLoadBalanceResponse) */ /* @@protoc_insertion_point(struct:grpc_lb_v1_InitialLoadBalanceResponse) */
} grpc_lb_v1_InitialLoadBalanceResponse; } grpc_lb_v1_InitialLoadBalanceResponse;
typedef struct _grpc_lb_v1_ServerList {
pb_callback_t servers;
bool has_expiration_interval;
grpc_lb_v1_Duration expiration_interval;
/* @@protoc_insertion_point(struct:grpc_lb_v1_ServerList) */
} grpc_lb_v1_ServerList;
typedef struct _grpc_lb_v1_LoadBalanceRequest { typedef struct _grpc_lb_v1_LoadBalanceRequest {
bool has_initial_request; bool has_initial_request;
grpc_lb_v1_InitialLoadBalanceRequest initial_request; grpc_lb_v1_InitialLoadBalanceRequest initial_request;
@ -67,13 +92,6 @@ typedef struct _grpc_lb_v1_LoadBalanceRequest {
/* @@protoc_insertion_point(struct:grpc_lb_v1_LoadBalanceRequest) */ /* @@protoc_insertion_point(struct:grpc_lb_v1_LoadBalanceRequest) */
} grpc_lb_v1_LoadBalanceRequest; } grpc_lb_v1_LoadBalanceRequest;
typedef struct _grpc_lb_v1_ServerList {
pb_callback_t servers;
bool has_expiration_interval;
grpc_lb_v1_Duration expiration_interval;
/* @@protoc_insertion_point(struct:grpc_lb_v1_ServerList) */
} grpc_lb_v1_ServerList;
typedef struct _grpc_lb_v1_LoadBalanceResponse { typedef struct _grpc_lb_v1_LoadBalanceResponse {
bool has_initial_response; bool has_initial_response;
grpc_lb_v1_InitialLoadBalanceResponse initial_response; grpc_lb_v1_InitialLoadBalanceResponse initial_response;
@ -86,61 +104,72 @@ typedef struct _grpc_lb_v1_LoadBalanceResponse {
/* Initializer values for message structs */ /* Initializer values for message structs */
#define grpc_lb_v1_Duration_init_default {false, 0, false, 0} #define grpc_lb_v1_Duration_init_default {false, 0, false, 0}
#define grpc_lb_v1_Timestamp_init_default {false, 0, false, 0}
#define grpc_lb_v1_LoadBalanceRequest_init_default {false, grpc_lb_v1_InitialLoadBalanceRequest_init_default, false, grpc_lb_v1_ClientStats_init_default} #define grpc_lb_v1_LoadBalanceRequest_init_default {false, grpc_lb_v1_InitialLoadBalanceRequest_init_default, false, grpc_lb_v1_ClientStats_init_default}
#define grpc_lb_v1_InitialLoadBalanceRequest_init_default {false, ""} #define grpc_lb_v1_InitialLoadBalanceRequest_init_default {false, ""}
#define grpc_lb_v1_ClientStats_init_default {false, 0, false, 0, false, 0} #define grpc_lb_v1_ClientStats_init_default {false, grpc_lb_v1_Timestamp_init_default, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
#define grpc_lb_v1_LoadBalanceResponse_init_default {false, grpc_lb_v1_InitialLoadBalanceResponse_init_default, false, grpc_lb_v1_ServerList_init_default} #define grpc_lb_v1_LoadBalanceResponse_init_default {false, grpc_lb_v1_InitialLoadBalanceResponse_init_default, false, grpc_lb_v1_ServerList_init_default}
#define grpc_lb_v1_InitialLoadBalanceResponse_init_default {false, "", false, grpc_lb_v1_Duration_init_default} #define grpc_lb_v1_InitialLoadBalanceResponse_init_default {false, "", false, grpc_lb_v1_Duration_init_default}
#define grpc_lb_v1_ServerList_init_default {{{NULL}, NULL}, false, grpc_lb_v1_Duration_init_default} #define grpc_lb_v1_ServerList_init_default {{{NULL}, NULL}, false, grpc_lb_v1_Duration_init_default}
#define grpc_lb_v1_Server_init_default {false, {0, {0}}, false, 0, false, "", false, 0} #define grpc_lb_v1_Server_init_default {false, {0, {0}}, false, 0, false, "", false, 0, false, 0}
#define grpc_lb_v1_Duration_init_zero {false, 0, false, 0} #define grpc_lb_v1_Duration_init_zero {false, 0, false, 0}
#define grpc_lb_v1_Timestamp_init_zero {false, 0, false, 0}
#define grpc_lb_v1_LoadBalanceRequest_init_zero {false, grpc_lb_v1_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v1_ClientStats_init_zero} #define grpc_lb_v1_LoadBalanceRequest_init_zero {false, grpc_lb_v1_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v1_ClientStats_init_zero}
#define grpc_lb_v1_InitialLoadBalanceRequest_init_zero {false, ""} #define grpc_lb_v1_InitialLoadBalanceRequest_init_zero {false, ""}
#define grpc_lb_v1_ClientStats_init_zero {false, 0, false, 0, false, 0} #define grpc_lb_v1_ClientStats_init_zero {false, grpc_lb_v1_Timestamp_init_zero, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0}
#define grpc_lb_v1_LoadBalanceResponse_init_zero {false, grpc_lb_v1_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v1_ServerList_init_zero} #define grpc_lb_v1_LoadBalanceResponse_init_zero {false, grpc_lb_v1_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v1_ServerList_init_zero}
#define grpc_lb_v1_InitialLoadBalanceResponse_init_zero {false, "", false, grpc_lb_v1_Duration_init_zero} #define grpc_lb_v1_InitialLoadBalanceResponse_init_zero {false, "", false, grpc_lb_v1_Duration_init_zero}
#define grpc_lb_v1_ServerList_init_zero {{{NULL}, NULL}, false, grpc_lb_v1_Duration_init_zero} #define grpc_lb_v1_ServerList_init_zero {{{NULL}, NULL}, false, grpc_lb_v1_Duration_init_zero}
#define grpc_lb_v1_Server_init_zero {false, {0, {0}}, false, 0, false, "", false, 0} #define grpc_lb_v1_Server_init_zero {false, {0, {0}}, false, 0, false, "", false, 0, false, 0}
/* Field tags (for use in manual encoding/decoding) */ /* Field tags (for use in manual encoding/decoding) */
#define grpc_lb_v1_ClientStats_total_requests_tag 1
#define grpc_lb_v1_ClientStats_client_rpc_errors_tag 2
#define grpc_lb_v1_ClientStats_dropped_requests_tag 3
#define grpc_lb_v1_Duration_seconds_tag 1 #define grpc_lb_v1_Duration_seconds_tag 1
#define grpc_lb_v1_Duration_nanos_tag 2 #define grpc_lb_v1_Duration_nanos_tag 2
#define grpc_lb_v1_InitialLoadBalanceRequest_name_tag 1 #define grpc_lb_v1_InitialLoadBalanceRequest_name_tag 1
#define grpc_lb_v1_Server_ip_address_tag 1 #define grpc_lb_v1_Server_ip_address_tag 1
#define grpc_lb_v1_Server_port_tag 2 #define grpc_lb_v1_Server_port_tag 2
#define grpc_lb_v1_Server_load_balance_token_tag 3 #define grpc_lb_v1_Server_load_balance_token_tag 3
#define grpc_lb_v1_Server_drop_request_tag 4 #define grpc_lb_v1_Server_drop_for_rate_limiting_tag 4
#define grpc_lb_v1_Server_drop_for_load_balancing_tag 5
#define grpc_lb_v1_Timestamp_seconds_tag 1
#define grpc_lb_v1_Timestamp_nanos_tag 2
#define grpc_lb_v1_ClientStats_timestamp_tag 1
#define grpc_lb_v1_ClientStats_num_calls_started_tag 2
#define grpc_lb_v1_ClientStats_num_calls_finished_tag 3
#define grpc_lb_v1_ClientStats_num_calls_finished_with_drop_for_rate_limiting_tag 4
#define grpc_lb_v1_ClientStats_num_calls_finished_with_drop_for_load_balancing_tag 5
#define grpc_lb_v1_ClientStats_num_calls_finished_with_client_failed_to_send_tag 6
#define grpc_lb_v1_ClientStats_num_calls_finished_known_received_tag 7
#define grpc_lb_v1_InitialLoadBalanceResponse_load_balancer_delegate_tag 1 #define grpc_lb_v1_InitialLoadBalanceResponse_load_balancer_delegate_tag 1
#define grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval_tag 2 #define grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval_tag 2
#define grpc_lb_v1_LoadBalanceRequest_initial_request_tag 1
#define grpc_lb_v1_LoadBalanceRequest_client_stats_tag 2
#define grpc_lb_v1_ServerList_servers_tag 1 #define grpc_lb_v1_ServerList_servers_tag 1
#define grpc_lb_v1_ServerList_expiration_interval_tag 3 #define grpc_lb_v1_ServerList_expiration_interval_tag 3
#define grpc_lb_v1_LoadBalanceRequest_initial_request_tag 1
#define grpc_lb_v1_LoadBalanceRequest_client_stats_tag 2
#define grpc_lb_v1_LoadBalanceResponse_initial_response_tag 1 #define grpc_lb_v1_LoadBalanceResponse_initial_response_tag 1
#define grpc_lb_v1_LoadBalanceResponse_server_list_tag 2 #define grpc_lb_v1_LoadBalanceResponse_server_list_tag 2
/* Struct field encoding specification for nanopb */ /* Struct field encoding specification for nanopb */
extern const pb_field_t grpc_lb_v1_Duration_fields[3]; extern const pb_field_t grpc_lb_v1_Duration_fields[3];
extern const pb_field_t grpc_lb_v1_Timestamp_fields[3];
extern const pb_field_t grpc_lb_v1_LoadBalanceRequest_fields[3]; extern const pb_field_t grpc_lb_v1_LoadBalanceRequest_fields[3];
extern const pb_field_t grpc_lb_v1_InitialLoadBalanceRequest_fields[2]; extern const pb_field_t grpc_lb_v1_InitialLoadBalanceRequest_fields[2];
extern const pb_field_t grpc_lb_v1_ClientStats_fields[4]; extern const pb_field_t grpc_lb_v1_ClientStats_fields[8];
extern const pb_field_t grpc_lb_v1_LoadBalanceResponse_fields[3]; extern const pb_field_t grpc_lb_v1_LoadBalanceResponse_fields[3];
extern const pb_field_t grpc_lb_v1_InitialLoadBalanceResponse_fields[3]; extern const pb_field_t grpc_lb_v1_InitialLoadBalanceResponse_fields[3];
extern const pb_field_t grpc_lb_v1_ServerList_fields[3]; extern const pb_field_t grpc_lb_v1_ServerList_fields[3];
extern const pb_field_t grpc_lb_v1_Server_fields[5]; extern const pb_field_t grpc_lb_v1_Server_fields[6];
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define grpc_lb_v1_Duration_size 22 #define grpc_lb_v1_Duration_size 22
#define grpc_lb_v1_LoadBalanceRequest_size 169 #define grpc_lb_v1_Timestamp_size 22
#define grpc_lb_v1_LoadBalanceRequest_size 226
#define grpc_lb_v1_InitialLoadBalanceRequest_size 131 #define grpc_lb_v1_InitialLoadBalanceRequest_size 131
#define grpc_lb_v1_ClientStats_size 33 #define grpc_lb_v1_ClientStats_size 90
#define grpc_lb_v1_LoadBalanceResponse_size (98 + grpc_lb_v1_ServerList_size) #define grpc_lb_v1_LoadBalanceResponse_size (98 + grpc_lb_v1_ServerList_size)
#define grpc_lb_v1_InitialLoadBalanceResponse_size 90 #define grpc_lb_v1_InitialLoadBalanceResponse_size 90
/* grpc_lb_v1_ServerList_size depends on runtime parameters */ /* grpc_lb_v1_ServerList_size depends on runtime parameters */
#define grpc_lb_v1_Server_size 83 #define grpc_lb_v1_Server_size 85
/* Message IDs (where set with "msgid" option) */ /* Message IDs (where set with "msgid" option) */
#ifdef PB_MSGID #ifdef PB_MSGID

@ -36,16 +36,18 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/ext/filters/client_channel/lb_policy_factory.h" #include "src/core/ext/filters/client_channel/lb_policy_factory.h"
#include "src/core/ext/filters/client_channel/parse_address.h"
grpc_lb_addresses* grpc_lb_addresses_create( grpc_lb_addresses* grpc_lb_addresses_create(
size_t num_addresses, const grpc_lb_user_data_vtable* user_data_vtable) { size_t num_addresses, const grpc_lb_user_data_vtable* user_data_vtable) {
grpc_lb_addresses* addresses = gpr_malloc(sizeof(grpc_lb_addresses)); grpc_lb_addresses* addresses = gpr_zalloc(sizeof(grpc_lb_addresses));
addresses->num_addresses = num_addresses; addresses->num_addresses = num_addresses;
addresses->user_data_vtable = user_data_vtable; addresses->user_data_vtable = user_data_vtable;
const size_t addresses_size = sizeof(grpc_lb_address) * num_addresses; const size_t addresses_size = sizeof(grpc_lb_address) * num_addresses;
addresses->addresses = gpr_malloc(addresses_size); addresses->addresses = gpr_zalloc(addresses_size);
memset(addresses->addresses, 0, addresses_size);
return addresses; return addresses;
} }
@ -69,7 +71,7 @@ grpc_lb_addresses* grpc_lb_addresses_copy(const grpc_lb_addresses* addresses) {
void grpc_lb_addresses_set_address(grpc_lb_addresses* addresses, size_t index, void grpc_lb_addresses_set_address(grpc_lb_addresses* addresses, size_t index,
void* address, size_t address_len, void* address, size_t address_len,
bool is_balancer, char* balancer_name, bool is_balancer, const char* balancer_name,
void* user_data) { void* user_data) {
GPR_ASSERT(index < addresses->num_addresses); GPR_ASSERT(index < addresses->num_addresses);
if (user_data != NULL) GPR_ASSERT(addresses->user_data_vtable != NULL); if (user_data != NULL) GPR_ASSERT(addresses->user_data_vtable != NULL);
@ -77,10 +79,22 @@ void grpc_lb_addresses_set_address(grpc_lb_addresses* addresses, size_t index,
memcpy(target->address.addr, address, address_len); memcpy(target->address.addr, address, address_len);
target->address.len = address_len; target->address.len = address_len;
target->is_balancer = is_balancer; target->is_balancer = is_balancer;
target->balancer_name = balancer_name; target->balancer_name = gpr_strdup(balancer_name);
target->user_data = user_data; target->user_data = user_data;
} }
bool grpc_lb_addresses_set_address_from_uri(grpc_lb_addresses* addresses,
size_t index, const grpc_uri* uri,
bool is_balancer,
const char* balancer_name,
void* user_data) {
grpc_resolved_address address;
if (!grpc_parse_uri(uri, &address)) return false;
grpc_lb_addresses_set_address(addresses, index, address.addr, address.len,
is_balancer, balancer_name, user_data);
return true;
}
int grpc_lb_addresses_cmp(const grpc_lb_addresses* addresses1, int grpc_lb_addresses_cmp(const grpc_lb_addresses* addresses1,
const grpc_lb_addresses* addresses2) { const grpc_lb_addresses* addresses2) {
if (addresses1->num_addresses > addresses2->num_addresses) return 1; if (addresses1->num_addresses > addresses2->num_addresses) return 1;
@ -147,6 +161,15 @@ grpc_arg grpc_lb_addresses_create_channel_arg(
return arg; return arg;
} }
grpc_lb_addresses* grpc_lb_addresses_find_channel_arg(
const grpc_channel_args* channel_args) {
const grpc_arg* lb_addresses_arg =
grpc_channel_args_find(channel_args, GRPC_ARG_LB_ADDRESSES);
if (lb_addresses_arg == NULL || lb_addresses_arg->type != GRPC_ARG_POINTER)
return NULL;
return lb_addresses_arg->value.pointer.p;
}
void grpc_lb_policy_factory_ref(grpc_lb_policy_factory* factory) { void grpc_lb_policy_factory_ref(grpc_lb_policy_factory* factory) {
factory->vtable->ref(factory); factory->vtable->ref(factory);
} }

@ -34,12 +34,13 @@
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_FACTORY_H
#include "src/core/ext/filters/client_channel/client_channel_factory.h"
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/ext/filters/client_channel/client_channel_factory.h"
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/ext/filters/client_channel/uri_parser.h"
// Channel arg key for grpc_lb_addresses. // Channel arg key for grpc_lb_addresses.
#define GRPC_ARG_LB_ADDRESSES "grpc.lb_addresses" #define GRPC_ARG_LB_ADDRESSES "grpc.lb_addresses"
@ -88,9 +89,18 @@ grpc_lb_addresses *grpc_lb_addresses_copy(const grpc_lb_addresses *addresses);
* Takes ownership of \a balancer_name. */ * Takes ownership of \a balancer_name. */
void grpc_lb_addresses_set_address(grpc_lb_addresses *addresses, size_t index, void grpc_lb_addresses_set_address(grpc_lb_addresses *addresses, size_t index,
void *address, size_t address_len, void *address, size_t address_len,
bool is_balancer, char *balancer_name, bool is_balancer, const char *balancer_name,
void *user_data); void *user_data);
/** Sets the value of the address at index \a index of \a addresses from \a uri.
* Returns true upon success, false otherwise. Takes ownership of \a
* balancer_name. */
bool grpc_lb_addresses_set_address_from_uri(grpc_lb_addresses *addresses,
size_t index, const grpc_uri *uri,
bool is_balancer,
const char *balancer_name,
void *user_data);
/** Compares \a addresses1 and \a addresses2. */ /** Compares \a addresses1 and \a addresses2. */
int grpc_lb_addresses_cmp(const grpc_lb_addresses *addresses1, int grpc_lb_addresses_cmp(const grpc_lb_addresses *addresses1,
const grpc_lb_addresses *addresses2); const grpc_lb_addresses *addresses2);
@ -103,6 +113,10 @@ void grpc_lb_addresses_destroy(grpc_exec_ctx *exec_ctx,
grpc_arg grpc_lb_addresses_create_channel_arg( grpc_arg grpc_lb_addresses_create_channel_arg(
const grpc_lb_addresses *addresses); const grpc_lb_addresses *addresses);
/** Returns the \a grpc_lb_addresses instance in \a channel_args or NULL */
grpc_lb_addresses *grpc_lb_addresses_find_channel_arg(
const grpc_channel_args *channel_args);
/** Arguments passed to LB policies. */ /** Arguments passed to LB policies. */
typedef struct grpc_lb_policy_args { typedef struct grpc_lb_policy_args {
grpc_client_channel_factory *client_channel_factory; grpc_client_channel_factory *client_channel_factory;

@ -48,7 +48,12 @@
#ifdef GRPC_HAVE_UNIX_SOCKET #ifdef GRPC_HAVE_UNIX_SOCKET
int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) { bool grpc_parse_unix(const grpc_uri *uri,
grpc_resolved_address *resolved_addr) {
if (strcmp("unix", uri->scheme) != 0) {
gpr_log(GPR_ERROR, "Expected 'unix' scheme, got '%s'", uri->scheme);
return false;
}
struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr; struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr;
const size_t maxlen = sizeof(un->sun_path); const size_t maxlen = sizeof(un->sun_path);
const size_t path_len = strnlen(uri->path, maxlen); const size_t path_len = strnlen(uri->path, maxlen);
@ -61,21 +66,29 @@ int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) {
#else /* GRPC_HAVE_UNIX_SOCKET */ #else /* GRPC_HAVE_UNIX_SOCKET */
int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) { abort(); } bool grpc_parse_unix(const grpc_uri *uri,
grpc_resolved_address *resolved_addr) {
abort();
}
#endif /* GRPC_HAVE_UNIX_SOCKET */ #endif /* GRPC_HAVE_UNIX_SOCKET */
int parse_ipv4(grpc_uri *uri, grpc_resolved_address *resolved_addr) { bool grpc_parse_ipv4(const grpc_uri *uri,
grpc_resolved_address *resolved_addr) {
if (strcmp("ipv4", uri->scheme) != 0) {
gpr_log(GPR_ERROR, "Expected 'ipv4' scheme, got '%s'", uri->scheme);
return false;
}
const char *host_port = uri->path; const char *host_port = uri->path;
char *host; char *host;
char *port; char *port;
int port_num; int port_num;
int result = 0; bool result = false;
struct sockaddr_in *in = (struct sockaddr_in *)resolved_addr->addr; struct sockaddr_in *in = (struct sockaddr_in *)resolved_addr->addr;
if (*host_port == '/') ++host_port; if (*host_port == '/') ++host_port;
if (!gpr_split_host_port(host_port, &host, &port)) { if (!gpr_split_host_port(host_port, &host, &port)) {
return 0; return false;
} }
memset(resolved_addr, 0, sizeof(grpc_resolved_address)); memset(resolved_addr, 0, sizeof(grpc_resolved_address));
@ -98,14 +111,19 @@ int parse_ipv4(grpc_uri *uri, grpc_resolved_address *resolved_addr) {
goto done; goto done;
} }
result = 1; result = true;
done: done:
gpr_free(host); gpr_free(host);
gpr_free(port); gpr_free(port);
return result; return result;
} }
int parse_ipv6(grpc_uri *uri, grpc_resolved_address *resolved_addr) { bool grpc_parse_ipv6(const grpc_uri *uri,
grpc_resolved_address *resolved_addr) {
if (strcmp("ipv6", uri->scheme) != 0) {
gpr_log(GPR_ERROR, "Expected 'ipv6' scheme, got '%s'", uri->scheme);
return false;
}
const char *host_port = uri->path; const char *host_port = uri->path;
char *host; char *host;
char *port; char *port;
@ -168,3 +186,15 @@ done:
gpr_free(port); gpr_free(port);
return result; return result;
} }
bool grpc_parse_uri(const grpc_uri *uri, grpc_resolved_address *resolved_addr) {
if (strcmp("unix", uri->scheme) == 0) {
return grpc_parse_unix(uri, resolved_addr);
} else if (strcmp("ipv4", uri->scheme) == 0) {
return grpc_parse_ipv4(uri, resolved_addr);
} else if (strcmp("ipv6", uri->scheme) == 0) {
return grpc_parse_ipv6(uri, resolved_addr);
}
gpr_log(GPR_ERROR, "Can't parse scheme '%s'", uri->scheme);
return false;
}

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

Loading…
Cancel
Save