Merge remote-tracking branch 'upstream/master' into auto-build-example

pull/6992/head
Yuchen Zeng 9 years ago
commit 09b1ec8ccb
  1. 8
      Makefile
  2. 1
      PYTHON-MANIFEST.in
  3. 2
      Rakefile
  4. 2
      build.yaml
  5. 4
      doc/PROTOCOL-HTTP2.md
  6. 118
      doc/compression.md
  7. 320
      doc/interop-test-descriptions.md
  8. 2
      examples/csharp/helloworld/GreeterClient/Program.cs
  9. 2
      examples/csharp/route_guide/RouteGuideClient/Program.cs
  10. 28
      examples/objective-c/auth_sample/AuthSample.xcodeproj/project.pbxproj
  11. 4
      examples/objective-c/auth_sample/AuthTestService.podspec
  12. 4
      examples/objective-c/helloworld/HelloWorld.podspec
  13. 24
      examples/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj
  14. 4
      examples/objective-c/route_guide/RouteGuide.podspec
  15. 18
      examples/objective-c/route_guide/RouteGuideClient.xcodeproj/project.pbxproj
  16. 10
      include/grpc++/impl/codegen/client_context.h
  17. 7
      include/grpc++/impl/codegen/server_context.h
  18. 27
      src/compiler/csharp_generator.cc
  19. 10
      src/core/ext/transport/chttp2/transport/chttp2_transport.c
  20. 14
      src/core/ext/transport/chttp2/transport/frame_rst_stream.c
  21. 5
      src/core/ext/transport/chttp2/transport/internal.h
  22. 11
      src/core/ext/transport/chttp2/transport/parsing.c
  23. 4
      src/core/ext/transport/chttp2/transport/writing.c
  24. 2
      src/core/lib/iomgr/tcp_server_windows.c
  25. 2
      src/csharp/.gitignore
  26. 1
      src/csharp/Grpc.Auth/Grpc.Auth.csproj
  27. 8
      src/csharp/Grpc.Auth/Grpc.Auth.project.json
  28. 18
      src/csharp/Grpc.Auth/Grpc.Auth.xproj
  29. 32
      src/csharp/Grpc.Auth/project.json
  30. 14
      src/csharp/Grpc.Core.Tests/AppDomainUnloadTest.cs
  31. 26
      src/csharp/Grpc.Core.Tests/CompressionTest.cs
  32. 1
      src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj
  33. 8
      src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.project.json
  34. 18
      src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.xproj
  35. 2
      src/csharp/Grpc.Core.Tests/NUnitMain.cs
  36. 2
      src/csharp/Grpc.Core.Tests/NUnitVersionTest.cs
  37. 3
      src/csharp/Grpc.Core.Tests/SanityTest.cs
  38. 56
      src/csharp/Grpc.Core.Tests/project.json
  39. 3
      src/csharp/Grpc.Core/Grpc.Core.csproj
  40. 12
      src/csharp/Grpc.Core/Grpc.Core.nuspec
  41. 8
      src/csharp/Grpc.Core/Grpc.Core.project.json
  42. 18
      src/csharp/Grpc.Core/Grpc.Core.xproj
  43. 6
      src/csharp/Grpc.Core/GrpcEnvironment.cs
  44. 2
      src/csharp/Grpc.Core/Internal/DefaultSslRootsOverride.cs
  45. 6
      src/csharp/Grpc.Core/Internal/NativeExtension.cs
  46. 2
      src/csharp/Grpc.Core/Internal/PlatformApis.cs
  47. 2
      src/csharp/Grpc.Core/Internal/SafeHandleZeroIsInvalid.cs
  48. 7
      src/csharp/Grpc.Core/Metadata.cs
  49. 42
      src/csharp/Grpc.Core/project.json
  50. 100
      src/csharp/Grpc.Dotnet.sln
  51. 3
      src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj
  52. 8
      src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.project.json
  53. 18
      src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.xproj
  54. 53
      src/csharp/Grpc.Examples.MathClient/project.json
  55. 3
      src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj
  56. 8
      src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.project.json
  57. 18
      src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.xproj
  58. 53
      src/csharp/Grpc.Examples.MathServer/project.json
  59. 1
      src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
  60. 8
      src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.project.json
  61. 18
      src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.xproj
  62. 10
      src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs
  63. 2
      src/csharp/Grpc.Examples.Tests/NUnitMain.cs
  64. 55
      src/csharp/Grpc.Examples.Tests/project.json
  65. 1
      src/csharp/Grpc.Examples/Grpc.Examples.csproj
  66. 8
      src/csharp/Grpc.Examples/Grpc.Examples.project.json
  67. 18
      src/csharp/Grpc.Examples/Grpc.Examples.xproj
  68. 15
      src/csharp/Grpc.Examples/MathGrpc.cs
  69. 27
      src/csharp/Grpc.Examples/project.json
  70. 1
      src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
  71. 8
      src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.project.json
  72. 18
      src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.xproj
  73. 2
      src/csharp/Grpc.HealthCheck.Tests/HealthClientServerTest.cs
  74. 2
      src/csharp/Grpc.HealthCheck.Tests/NUnitMain.cs
  75. 55
      src/csharp/Grpc.HealthCheck.Tests/project.json
  76. 1
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
  77. 8
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.project.json
  78. 18
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.xproj
  79. 15
      src/csharp/Grpc.HealthCheck/HealthGrpc.cs
  80. 35
      src/csharp/Grpc.HealthCheck/project.json
  81. 1
      src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
  82. 8
      src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.project.json
  83. 18
      src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.xproj
  84. 56
      src/csharp/Grpc.IntegrationTesting.Client/project.json
  85. 1
      src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj
  86. 8
      src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.project.json
  87. 18
      src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.xproj
  88. 56
      src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json
  89. 1
      src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
  90. 8
      src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.project.json
  91. 18
      src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.xproj
  92. 56
      src/csharp/Grpc.IntegrationTesting.Server/project.json
  93. 5
      src/csharp/Grpc.IntegrationTesting.StressClient/Grpc.IntegrationTesting.StressClient.csproj
  94. 8
      src/csharp/Grpc.IntegrationTesting.StressClient/Grpc.IntegrationTesting.StressClient.project.json
  95. 19
      src/csharp/Grpc.IntegrationTesting.StressClient/Grpc.IntegrationTesting.StressClient.xproj
  96. 56
      src/csharp/Grpc.IntegrationTesting.StressClient/project.json
  97. 6
      src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
  98. 12
      src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
  99. 3
      src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs
  100. 1
      src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
  101. Some files were not shown because too many files have changed in this diff Show More

@ -4376,7 +4376,7 @@ LIBINTEROP_SERVER_MAIN_SRC = \
$(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc \
test/cpp/interop/server_main.cc \
test/cpp/interop/interop_server.cc \
PUBLIC_HEADERS_CXX += \
@ -4422,7 +4422,7 @@ ifneq ($(NO_DEPS),true)
-include $(LIBINTEROP_SERVER_MAIN_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/interop/server_main.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/interop/interop_server.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc
LIBQPS_SRC = \
@ -6389,6 +6389,7 @@ LIBEND2END_TESTS_SRC = \
test/core/end2end/tests/simple_delayed_request.c \
test/core/end2end/tests/simple_metadata.c \
test/core/end2end/tests/simple_request.c \
test/core/end2end/tests/streaming_error_response.c \
test/core/end2end/tests/trailing_metadata.c \
PUBLIC_HEADERS_C += \
@ -6465,6 +6466,7 @@ LIBEND2END_NOSEC_TESTS_SRC = \
test/core/end2end/tests/simple_delayed_request.c \
test/core/end2end/tests/simple_metadata.c \
test/core/end2end/tests/simple_request.c \
test/core/end2end/tests/streaming_error_response.c \
test/core/end2end/tests/trailing_metadata.c \
PUBLIC_HEADERS_C += \
@ -14937,8 +14939,8 @@ test/cpp/end2end/test_service_impl.cc: $(OPENSSL_DEP)
test/cpp/interop/client.cc: $(OPENSSL_DEP)
test/cpp/interop/client_helper.cc: $(OPENSSL_DEP)
test/cpp/interop/interop_client.cc: $(OPENSSL_DEP)
test/cpp/interop/interop_server.cc: $(OPENSSL_DEP)
test/cpp/interop/server_helper.cc: $(OPENSSL_DEP)
test/cpp/interop/server_main.cc: $(OPENSSL_DEP)
test/cpp/qps/client_async.cc: $(OPENSSL_DEP)
test/cpp/qps/client_sync.cc: $(OPENSSL_DEP)
test/cpp/qps/driver.cc: $(OPENSSL_DEP)

@ -1,6 +1,7 @@
recursive-include src/python/grpcio/grpc *.c *.h *.py *.pyx *.pxd *.pxi *.python *.pem
recursive-exclude src/python/grpcio/grpc/_cython *.so *.pyd
graft src/python/grpcio/tests
graft src/python/grpcio/grpcio.egg-info
graft src/core
graft src/boringssl
graft include/grpc

@ -77,7 +77,7 @@ task 'dlls' do
grpc_config = ENV['GRPC_CONFIG'] || 'opt'
verbose = ENV['V'] || '0'
env = 'CPPFLAGS="-D_WIN32_WINNT=0x600 -DUNICODE -D_UNICODE" '
env = 'CPPFLAGS="-D_WIN32_WINNT=0x600 -DUNICODE -D_UNICODE -Wno-unused-variable -Wno-unused-result" '
env += 'LDFLAGS=-static '
env += 'SYSTEM=MINGW32 '
env += 'EMBED_ZLIB=true '

@ -1117,7 +1117,7 @@ libs:
- src/proto/grpc/testing/empty.proto
- src/proto/grpc/testing/messages.proto
- src/proto/grpc/testing/test.proto
- test/cpp/interop/server_main.cc
- test/cpp/interop/interop_server.cc
deps:
- interop_server_helper
- grpc++_test_util

@ -38,7 +38,7 @@ Request-Headers are delivered as HTTP2 headers in HEADERS + CONTINUATION frames.
* **Nanosecond** → "n"
* **Content-Type** → "content-type" "application/grpc" [("+proto" / "+json" / {_custom_})]
* **Content-Coding** → "identity" / "gzip" / "deflate" / "snappy" / {_custom_}
* **Message-Encoding** → "grpc-encoding" Content-Coding
* <a name="message-encoding"></a>**Message-Encoding** → "grpc-encoding" Content-Coding
* **Message-Accept-Encoding** → "grpc-accept-encoding" Content-Coding \*("," Content-Coding)
* **User-Agent** → "user-agent" {_structured user-agent string_}
* **Message-Type** → "grpc-message-type" {_type name for message schema_}
@ -83,7 +83,7 @@ binary values' lengths being post-Base64.
The repeated sequence of **Length-Prefixed-Message** items is delivered in DATA frames
* **Length-Prefixed-Message** → Compressed-Flag Message-Length Message
* **Compressed-Flag** → 0 / 1 # encoded as 1 byte unsigned integer
* <a name="compressed-flag"></a>**Compressed-Flag** → 0 / 1 # encoded as 1 byte unsigned integer
* **Message-Length** → {_length of Message_} # encoded as 4 byte unsigned integer
* **Message** → \*{binary octet}

@ -0,0 +1,118 @@
## **gRPC Compression**
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
interpreted as described in [RFC 2119](http://www.ietf.org/rfc/rfc2119.txt).
### Intent
Compression is used to reduce the amount of bandwidth used between peers. The
compression supported by gRPC acts _at the individual message level_, taking
_message_ [as defined in the wire format
document](PROTOCOL-HTTP2.md).
The implementation supports different compression algorithms. A _default
compression level_, to be used in the absence of message-specific settings, MAY
be specified for during channel creation.
The ability to control compression settings per call and to enable/disable
compression on a per message basis MAY be used to prevent CRIME/BEAST attacks.
It also allows for asymmetric compression communication, whereby a response MAY
be compressed differently, if at all.
### Specification
Compression MAY be configured by the Client Application by calling the
appropriate API method. There are two scenarios where compression MAY be
configured:
+ At channel creation time, which sets the channel default compression and
therefore the compression that SHALL be used in the absence of per-RPC
compression configuration.
+ At response time, via:
+ For unary RPCs, the {Client,Server}Context instance.
+ For streaming RPCs, the {Client,Server}Writer instance. In this case,
configuration is reduced to disabling compression altogether.
### Compression Method Asymmetry Between Peers
A gRPC peer MAY choose to respond using a different compression method to that
of the request, including not performing any compression, regardless of channel
and RPC settings (for example, if compression would result in small or negative
gains).
When a message from a client compressed with an unsupported algorithm is
processed by a server, it WILL result in an `UNIMPLEMENTED` error status on the
server. The server will then include in its response a `grpc-accept-encoding`
header specifying the algorithms it does accept. If an `UNIMPLEMENTED` error
status is returned from the server despite having used one of the algorithms
from the `grpc-accept-encoding` header, the cause MUST NOT be related to
compression. Data sent from a server compressed with an algorithm not supported
by the client WILL result in an `INTERNAL` error status on the client side.
Note that a peer MAY choose to not disclose all the encodings it supports.
However, if it receives a message compressed in an undisclosed but supported
encoding, it MUST include said encoding in the response's `grpc-accept-encoding
h`eader.
For every message a server is requested to compress using an algorithm it knows
the client doesn't support (as indicated by the last `grpc-accept-encoding`
header received from the client), it SHALL send the message uncompressed.
### Specific Disabling of Compression
If the user (through the previously described mechanisms) requests to disable
compression the next message MUST be sent uncompressed. This is instrumental in
preventing BEAST/CRIME attacks. This applies to both the the unary and streaming
cases.
### Compression Levels and Algorithms
The set of supported algorithm is implementation dependent. In order to simplify
the public API and to operate seamlessly across implementations (both in terms
of languages but also different version of the same one), we introduce the idea
of _compression levels_ (such as "low", "medium", "high").
Levels map to concrete algorithms and/or their settings (such as "low" mapping
to "gzip -3" and "high" mapping to "gzip -9") automatically depending on what a
peer is known to support. A server is always aware of what its clients support,
as clients disclose it in their Message-Accept-Encoding header as part of their
initial call. A client doesn't a priori (presently) know which algorithms a
server supports. This issue can be addressed with an initial negotiation of
capabilities or an automatic retry mechanism. These features will be implemented
in the future. Currently however, compression levels are only supported at the
server side, which is aware of the client's capabilities through the incoming
Message-Accept-Encoding header.
### Propagation to child RPCs
The inheritance of the compression configuration by child RPCs is left up to the
implementation. Note that in the absence of changes to the parent channel, its
configuration will be used.
### Test cases
1. When a compression level is not specified for either the channel or the
message, the default channel level _none_ is considered: data MUST NOT be
compressed.
1. When per-RPC compression configuration isn't present for a message, the
channel compression configuration MUST be used.
1. When a compression method (including no compression) is specified for an
outgoing message, the message MUST be compressed accordingly.
1. A message compressed by a client in a way not supported by its server MUST
fail with status `UNIMPLEMENTED`, its associated description indicating the
unsupported condition as well as the supported ones. The returned
`grpc-accept-encoding` header MUST NOT contain the compression method
(encoding) used.
1. A message compressed by a server in a way not supported by its client MUST
fail with status `INTERNAL`, its associated description indicating the
unsupported condition as well as the supported ones. The returned
`grpc-accept-encoding` header MUST NOT contain the compression method
(encoding) used.
1. An ill-constructed message with its [Compressed-Flag
bit](PROTOCOL-HTTP2.md#compressed-flag)
set but lacking a
"[grpc-encoding](PROTOCOL-HTTP2.md#message-encoding)"
entry different from _identity_ in its metadata MUST fail with `INTERNAL`
status, its associated description indicating the invalid Compressed-Flag
condition.

@ -68,14 +68,12 @@ control (even if compression is enabled on the channel).
Server features:
* [UnaryCall][]
* [Compressable Payload][]
Procedure:
1. Client calls UnaryCall with:
```
{
response_type: COMPRESSABLE
response_size: 314159
payload:{
body: 271828 bytes of zeros
@ -85,56 +83,106 @@ Procedure:
Client asserts:
* call was successful
* response payload type is COMPRESSABLE
* response payload body is 314159 bytes in size
* clients are free to assert that the response payload body contents are zero
and comparing the entire response message against a golden response
### large_compressed_unary
This test verifies compressed unary calls succeed in sending messages. It
sends one unary request for every payload type, with and without requesting a
compressed response from the server.
In all scenarios, whether compression was actually performed is determined by
the compression bit in the response's message flags.
### client_compressed_unary
This test verifies the client can compress unary messages by sending two unary
calls, for compressed and uncompressed payloads. It also sends an initial
probing request to verify whether the server supports the [CompressedRequest][]
feature by checking if the probing call fails with an `INVALID_ARGUMENT` status.
Server features:
* [UnaryCall][]
* [Compressable Payload][]
* [Uncompressable Payload][]
* [CompressedRequest][]
Procedure:
1. Client calls UnaryCall with:
1. Client calls UnaryCall with the feature probe, an *uncompressed* message:
```
{
expect_compressed:{
value: true
}
response_size: 314159
payload:{
body: 271828 bytes of zeros
}
}
```
1. Client calls UnaryCall with the *compressed* message:
```
{
expect_compressed:{
value: true
}
response_size: 314159
payload:{
body: 271828 bytes of zeros
}
}
```
1. Client calls UnaryCall with the *uncompressed* message:
```
{
request_compressed_response: bool
response_type: COMPRESSABLE
expect_compressed:{
value: false
}
response_size: 314159
payload:{
body: 271828 bytes of zeros
}
}
```
Client asserts:
* call was successful
* response payload type is COMPRESSABLE
* if `request_compressed_response` is false, the response MUST NOT have the
compressed message flag set.
* if `request_compressed_response` is true, the response MUST have the
compressed message flag set.
* response payload body is 314159 bytes in size
* clients are free to assert that the response payload body contents are
zero and comparing the entire response message against a golden response
* First call failed with `INVALID_ARGUMENT` status.
* Subsequent calls were successful.
* Response payload body is 314159 bytes in size.
* Clients are free to assert that the response payload body contents are
zeros and comparing the entire response message against a golden response.
2. Client calls UnaryCall with:
### server_compressed_unary
This test verifies the server can compress unary messages. It sends two unary
requests, expecting the server's response to be compressed or not according to
the `response_compressed` boolean.
Whether compression was actually performed is determined by the compression bit
in the response's message flags. *Note that some languages may not have access
to the message flags*.
Server features:
* [UnaryCall][]
* [CompressedResponse][]
Procedure:
1. Client calls UnaryCall with `SimpleRequest`:
```
{
response_compressed:{
value: true
}
response_size: 314159
payload:{
body: 271828 bytes of zeros
}
}
```
```
{
request_compressed_response: bool
response_type: UNCOMPRESSABLE
response_compressed:{
value: false
}
response_size: 314159
payload:{
body: 271828 bytes of zeros
@ -143,11 +191,13 @@ Procedure:
```
Client asserts:
* call was successful
* response payload type is UNCOMPRESSABLE
* the response MAY have the compressed message flag set. Some
implementations will choose to compress the payload even when the output
size if larger than the input.
* response payload body is 314159 bytes in size
* when `response_compressed` is true, the response MUST have the
compressed message flag set.
* when `response_compressed` is false, the response MUST NOT have
the compressed message flag set.
* response payload body is 314159 bytes in size in both cases.
* clients are free to assert that the response payload body contents are
zero and comparing the entire response message against a golden response
### client_streaming
@ -156,7 +206,6 @@ This test verifies that client-only streaming succeeds.
Server features:
* [StreamingInputCall][]
* [Compressable Payload][]
Procedure:
1. Client calls StreamingInputCall
@ -206,25 +255,81 @@ Client asserts:
* call was successful
* response aggregated_payload_size is 74922
### client_compressed_streaming
This test verifies the client can compress requests on per-message basis by
performing a two-request streaming call. It also sends an initial probing
request to verify whether the server supports the [CompressedRequest][] feature
by checking if the probing call fails with an `INVALID_ARGUMENT` status.
Procedure:
1. Client calls `StreamingInputCall` and sends the following feature-probing
*uncompressed* `StreamingInputCallRequest` message
```
{
expect_compressed:{
value: true
}
payload:{
body: 27182 bytes of zeros
}
}
```
If the call fails with `INVALID_ARGUMENT`, the test fails. Otherwise, we
continue.
1. Client calls `StreamingInputCall` again, sending the *compressed* message
```
{
expect_compressed:{
value: true
}
payload:{
body: 27182 bytes of zeros
}
}
```
1. And finally, the *uncompressed* message
```
{
expect_compressed:{
value: false
}
payload:{
body: 45904 bytes of zeros
}
}
```
1. Client half-closes
Client asserts:
* First call fails with `INVALID_ARGUMENT`.
* Next calls succeeds.
* Response aggregated payload size is 73086.
### server_streaming
This test verifies that server-only streaming succeeds.
Server features:
* [StreamingOutputCall][]
* [Compressable Payload][]
Procedure:
1. Client calls StreamingOutputCall with:
1. Client calls StreamingOutputCall with `StreamingOutputCallRequest`:
```
{
response_type:COMPRESSABLE
response_parameters:{
size: 31415
}
response_parameters:{
size: 59
size: 9
}
response_parameters:{
size: 2653
@ -238,103 +343,64 @@ Procedure:
Client asserts:
* call was successful
* exactly four responses
* response payloads are COMPRESSABLE
* response payload bodies are sized (in order): 31415, 9, 2653, 58979
* clients are free to assert that the response payload body contents are zero
and comparing the entire response messages against golden responses
### server_compressed_streaming
This test verifies that server-only compressed streaming succeeds.
This test verifies that the server can compress streaming messages and disable
compression on individual messages.
Server features:
* [StreamingOutputCall][]
* [Compressable Payload][]
* [Uncompressable Payload][]
* [CompressedResponse][]
Procedure:
1. Client calls StreamingOutputCall with:
1. Client calls StreamingOutputCall with `StreamingOutputCallRequest`:
```
{
request_compressed_response: bool
response_type:COMPRESSABLE
response_parameters:{
compressed: {
value: true
}
size: 31415
}
response_parameters:{
size: 59
}
response_parameters:{
size: 2653
}
response_parameters:{
size: 58979
compressed: {
value: false
}
size: 92653
}
}
```
Client asserts:
* call was successful
* exactly four responses
* response payloads are COMPRESSABLE
* if `request_compressed_response` is false, the response's messages MUST
* exactly two responses
* when `response_compressed` is false, the response's messages MUST
NOT have the compressed message flag set.
* if `request_compressed_response` is true, the response's messages MUST
* when `response_compressed` is true, the response's messages MUST
have the compressed message flag set.
* response payload bodies are sized (in order): 31415, 59, 2653, 58979
* response payload bodies are sized (in order): 31415, 92653
* clients are free to assert that the response payload body contents are
zero and comparing the entire response messages against golden responses
2. Client calls StreamingOutputCall with:
```
{
request_compressed_response: bool
response_type:UNCOMPRESSABLE
response_parameters:{
size: 31415
}
response_parameters:{
size: 59
}
response_parameters:{
size: 2653
}
response_parameters:{
size: 58979
}
}
```
Client asserts:
* call was successful
* exactly four responses
* response payloads are UNCOMPRESSABLE
* the response MAY have the compressed message flag set. Some
implementations will choose to compress the payload even when the output
size if larger than the input.
* response payload bodies are sized (in order): 31415, 59, 2653, 58979
* clients are free to assert that the body of the responses are identical to
the golden uncompressable data at `test/cpp/interop/rnd.dat`.
### ping_pong
This test verifies that full duplex bidi is supported.
Server features:
* [FullDuplexCall][]
* [Compressable Payload][]
Procedure:
1. Client calls FullDuplexCall with:
```
{
response_type: COMPRESSABLE
response_parameters:{
size: 31415
}
@ -348,9 +414,8 @@ Procedure:
```
{
response_type: COMPRESSABLE
response_parameters:{
size: 59
size: 9
}
payload:{
body: 8 bytes of zeros
@ -362,7 +427,6 @@ Procedure:
```
{
response_type: COMPRESSABLE
response_parameters:{
size: 2653
}
@ -376,7 +440,6 @@ Procedure:
```
{
response_type: COMPRESSABLE
response_parameters:{
size: 58979
}
@ -391,7 +454,6 @@ Procedure:
Client asserts:
* call was successful
* exactly four responses
* response payloads are COMPRESSABLE
* response payload bodies are sized (in order): 31415, 9, 2653, 58979
* clients are free to assert that the response payload body contents are zero
and comparing the entire response messages against golden responses
@ -421,12 +483,12 @@ with desired oauth scope.
The test uses `--default_service_account` with GCE service account email and
`--oauth_scope` with the OAuth scope to use. For testing against
grpc-test.sandbox.googleapis.com, "https://www.googleapis.com/auth/xapi.zoo" should
grpc-test.sandbox.googleapis.com, "https://www.googleapis.com/auth/xapi.zoo"
should
be passed in as `--oauth_scope`.
Server features:
* [UnaryCall][]
* [Compressable Payload][]
* [Echo Authenticated Username][]
* [Echo OAuth Scope][]
@ -436,7 +498,6 @@ Procedure:
```
{
response_type: COMPRESSABLE
response_size: 314159
payload:{
body: 271828 bytes of zeros
@ -448,7 +509,8 @@ Procedure:
Client asserts:
* call was successful
* received SimpleResponse.username equals the value of `--default_service_account` flag
* received SimpleResponse.username equals the value of
`--default_service_account` flag
* received SimpleResponse.oauth_scope is in `--oauth_scope`
* response payload body is 314159 bytes in size
* clients are free to assert that the response payload body contents are zero
@ -469,7 +531,6 @@ variable GOOGLE_APPLICATION_CREDENTIALS.
Server features:
* [UnaryCall][]
* [Compressable Payload][]
* [Echo Authenticated Username][]
* [Echo OAuth Scope][]
@ -479,7 +540,6 @@ Procedure:
```
{
response_type: COMPRESSABLE
response_size: 314159
payload:{
body: 271828 bytes of zeros
@ -492,7 +552,8 @@ Client asserts:
* call was successful
* received SimpleResponse.username is not empty and is in the json key file used
by the auth library. The client can optionally check the username matches the
email address in the key file or equals the value of `--default_service_account` flag.
email address in the key file or equals the value of `--default_service_account`
flag.
* response payload body is 314159 bytes in size
* clients are free to assert that the response payload body contents are zero
and comparing the entire response message against a golden response
@ -518,18 +579,18 @@ variable GOOGLE_APPLICATION_CREDENTIALS, *OR* if GCE credentials is used to
fetch the token, `--default_service_account` can be used to pass in GCE service
account email.
- uses the flag `--oauth_scope` for the oauth scope. For testing against
grpc-test.sandbox.googleapis.com, "https://www.googleapis.com/auth/xapi.zoo" should
be passed as the `--oauth_scope`.
grpc-test.sandbox.googleapis.com, "https://www.googleapis.com/auth/xapi.zoo"
should be passed as the `--oauth_scope`.
Server features:
* [UnaryCall][]
* [Compressable Payload][]
* [Echo Authenticated Username][]
* [Echo OAuth Scope][]
Procedure:
1. Client uses the auth library to obtain an authorization token
2. Client configures the channel to use AccessTokenCredentials with the access token obtained in step 1
2. Client configures the channel to use AccessTokenCredentials with the access
token obtained in step 1
3. Client calls UnaryCall with the following message
```
@ -550,22 +611,21 @@ json key file or GCE default service account email.
Similar to the other auth tests, this test is only for cloud-to-prod path.
This test verifies unary calls succeed in sending messages using a JWT or a service account
credentials set on the RPC.
This test verifies unary calls succeed in sending messages using a JWT or a
service account credentials set on the RPC.
The test
- uses the flag `--service_account_key_file` with the path to a json key file
downloaded from https://console.developers.google.com. Alternately, if using a
usable auth implementation, it may specify the file location in the environment
variable GOOGLE_APPLICATION_CREDENTIALS
- optionally uses the flag `--oauth_scope` for the oauth scope if implementator
- optionally uses the flag `--oauth_scope` for the oauth scope if implementator
wishes to use service account credential instead of JWT credential. For testing
against grpc-test.sandbox.googleapis.com, oauth scope
against grpc-test.sandbox.googleapis.com, oauth scope
"https://www.googleapis.com/auth/xapi.zoo" should be used.
Server features:
* [UnaryCall][]
* [Compressable Payload][]
* [Echo Authenticated Username][]
* [Echo OAuth Scope][]
@ -596,7 +656,6 @@ by the server.
Server features:
* [UnaryCall][]
* [FullDuplexCall][]
* [Compressable Payload][]
* [Echo Metadata][]
Procedure:
@ -611,7 +670,6 @@ Procedure:
```
{
response_type: COMPRESSABLE
response_size: 314159
payload:{
body: 271828 bytes of zeros
@ -630,7 +688,6 @@ Procedure:
```
{
response_type: COMPRESSABLE
response_size: 314159
payload:{
body: 271828 bytes of zeros
@ -736,14 +793,12 @@ from the server.
Server features:
* [FullDuplexCall][]
* [Compressable Payload][]
Procedure:
1. Client starts FullDuplexCall with
```
{
response_type: COMPRESSABLE
response_parameters:{
size: 31415
}
@ -887,6 +942,21 @@ payload body of size `SimpleRequest.response_size` bytes and type as appropriate
for the `SimpleRequest.response_type`. If the server does not support the
`response_type`, then it should fail the RPC with `INVALID_ARGUMENT`.
### CompressedResponse
[CompressedResponse]: #compressedresponse
When the client sets `response_compressed` to true, the server's response is
sent back compressed. Note that `response_compressed` is present on both
`SimpleRequest` (unary) and `StreamingOutputCallRequest` (streaming).
### CompressedRequest
[CompressedRequest]: #compressedrequest
When the client sets `expect_compressed` to true, the server expects the client
request to be compressed. If it's not, it fails the RPC with `INVALID_ARGUMENT`.
Note that `response_compressed` is present on both `SimpleRequest` (unary) and
`StreamingOutputCallRequest` (streaming).
### StreamingInputCall
[StreamingInputCall]: #streaminginputcall
@ -913,20 +983,6 @@ payload body of size ResponseParameters.size bytes, as specified by its
respective ResponseParameters. After receiving half close and sending all
responses, it closes with OK.
### Compressable Payload
[Compressable Payload]: #compressable-payload
When the client requests COMPRESSABLE payload, the response includes a payload
of the size requested containing all zeros and the payload type is
COMPRESSABLE.
### Uncompressable Payload
[Uncompressable Payload]: #uncompressable-payload
When the client requests UNCOMPRESSABLE payload, the response includes a payload
of the size requested containing uncompressable data and the payload type is
UNCOMPRESSABLE.
### Echo Status
[Echo Status]: #echo-status
When the client sends a response_status in the request payload, the server closes

@ -39,7 +39,7 @@ namespace GreeterClient
{
Channel channel = new Channel("127.0.0.1:50051", ChannelCredentials.Insecure);
var client = Greeter.NewClient(channel);
var client = new Greeter.GreeterClient(channel);
String user = "you";
var reply = client.SayHello(new HelloRequest { Name = user });

@ -231,7 +231,7 @@ namespace Routeguide
static void Main(string[] args)
{
var channel = new Channel("127.0.0.1:50052", ChannelCredentials.Insecure);
var client = new RouteGuideClient(RouteGuide.NewClient(channel));
var client = new RouteGuideClient(new RouteGuide.RouteGuideClient(channel));
// Looking for a valid feature
client.GetFeature(409146138, -746188906);

@ -116,11 +116,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 63E1E9A21B28CB2100EF0978 /* Build configuration list for PBXNativeTarget "AuthSample" */;
buildPhases = (
DAABBA7B5788A39108D7CA83 /* Check Pods Manifest.lock */,
DAABBA7B5788A39108D7CA83 /* [CP] Check Pods Manifest.lock */,
63E1E9781B28CB2000EF0978 /* Sources */,
63E1E9791B28CB2000EF0978 /* Frameworks */,
63E1E97A1B28CB2000EF0978 /* Resources */,
AEFCCC69DD59CE8F6EB769D7 /* Copy Pods Resources */,
AEFCCC69DD59CE8F6EB769D7 /* [CP] Copy Pods Resources */,
D24F6598302C412D4B863D6F /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -177,14 +178,14 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
AEFCCC69DD59CE8F6EB769D7 /* Copy Pods Resources */ = {
AEFCCC69DD59CE8F6EB769D7 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -192,14 +193,29 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AuthSample/Pods-AuthSample-resources.sh\"\n";
showEnvVarsInLog = 0;
};
DAABBA7B5788A39108D7CA83 /* Check Pods Manifest.lock */ = {
D24F6598302C412D4B863D6F /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AuthSample/Pods-AuthSample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
DAABBA7B5788A39108D7CA83 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;

@ -2,6 +2,10 @@ Pod::Spec.new do |s|
s.name = "AuthTestService"
s.version = "0.0.1"
s.license = "New BSD"
s.authors = { 'gRPC contributors' => 'grpc-io@googlegroups.com' }
s.homepage = "http://www.grpc.io/"
s.summary = "AuthTestService example"
s.source = { :git => 'https://github.com/grpc/grpc.git' }
s.ios.deployment_target = "7.1"
s.osx.deployment_target = "10.9"

@ -2,6 +2,10 @@ Pod::Spec.new do |s|
s.name = "HelloWorld"
s.version = "0.0.1"
s.license = "New BSD"
s.authors = { 'gRPC contributors' => 'grpc-io@googlegroups.com' }
s.homepage = "http://www.grpc.io/"
s.summary = "HelloWorld example"
s.source = { :git => 'https://github.com/grpc/grpc.git' }
s.ios.deployment_target = "7.1"
s.osx.deployment_target = "10.9"

@ -7,7 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
3EF35C14BDC2B65E21837F02 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 43AB08B32839A6700EA00DD4 /* libPods.a */; };
5E3690661B2A23800040F884 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3690651B2A23800040F884 /* main.m */; };
5E3690691B2A23800040F884 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E3690681B2A23800040F884 /* AppDelegate.m */; };
5E36906C1B2A23800040F884 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E36906B1B2A23800040F884 /* ViewController.m */; };
@ -18,7 +17,6 @@
/* Begin PBXFileReference section */
0C432EF610DB15C0F47A66BB /* Pods-HelloWorld.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorld.release.xcconfig"; path = "Pods/Target Support Files/Pods-HelloWorld/Pods-HelloWorld.release.xcconfig"; sourceTree = "<group>"; };
43AB08B32839A6700EA00DD4 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
5E3690601B2A23800040F884 /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; };
5E3690641B2A23800040F884 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5E3690651B2A23800040F884 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@ -37,7 +35,6 @@
buildActionMask = 2147483647;
files = (
EF61CF6AE2536A31D47F0E63 /* libPods-HelloWorld.a in Frameworks */,
3EF35C14BDC2B65E21837F02 /* libPods.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -88,7 +85,6 @@
isa = PBXGroup;
children = (
6B4E1F55F8A2EC95A0E7EE88 /* libPods-HelloWorld.a */,
43AB08B32839A6700EA00DD4 /* libPods.a */,
);
name = Frameworks;
sourceTree = "<group>";
@ -109,12 +105,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 5E3690831B2A23810040F884 /* Build configuration list for PBXNativeTarget "HelloWorld" */;
buildPhases = (
ACF9162361FB8F24C70657DE /* Check Pods Manifest.lock */,
ACF9162361FB8F24C70657DE /* [CP] Check Pods Manifest.lock */,
5E36905C1B2A23800040F884 /* Sources */,
5E36905D1B2A23800040F884 /* Frameworks */,
5E36905E1B2A23800040F884 /* Resources */,
4C7D815378D98AB3BFC1A7D5 /* Copy Pods Resources */,
BB76529986A8BFAF19A385B1 /* Embed Pods Frameworks */,
4C7D815378D98AB3BFC1A7D5 /* [CP] Copy Pods Resources */,
BB76529986A8BFAF19A385B1 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -170,14 +166,14 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
4C7D815378D98AB3BFC1A7D5 /* Copy Pods Resources */ = {
4C7D815378D98AB3BFC1A7D5 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -185,14 +181,14 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-resources.sh\"\n";
showEnvVarsInLog = 0;
};
ACF9162361FB8F24C70657DE /* Check Pods Manifest.lock */ = {
ACF9162361FB8F24C70657DE /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -200,19 +196,19 @@
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
BB76529986A8BFAF19A385B1 /* Embed Pods Frameworks */ = {
BB76529986A8BFAF19A385B1 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HelloWorld/Pods-HelloWorld-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

@ -2,6 +2,10 @@ Pod::Spec.new do |s|
s.name = "RouteGuide"
s.version = "0.0.1"
s.license = "New BSD"
s.authors = { 'gRPC contributors' => 'grpc-io@googlegroups.com' }
s.homepage = "http://www.grpc.io/"
s.summary = "RouteGuide example"
s.source = { :git => 'https://github.com/grpc/grpc.git' }
s.ios.deployment_target = "7.1"
s.osx.deployment_target = "10.9"

@ -116,12 +116,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 632527A31B1D0396003073D9 /* Build configuration list for PBXNativeTarget "RouteGuideClient" */;
buildPhases = (
C6FC30AD2376EC04317237C5 /* Check Pods Manifest.lock */,
C6FC30AD2376EC04317237C5 /* [CP] Check Pods Manifest.lock */,
632527791B1D0395003073D9 /* Sources */,
6325277A1B1D0395003073D9 /* Frameworks */,
6325277B1B1D0395003073D9 /* Resources */,
FFE0BCF30339E7A50A989EAB /* Copy Pods Resources */,
B5388EC5A25E89021740B916 /* Embed Pods Frameworks */,
FFE0BCF30339E7A50A989EAB /* [CP] Copy Pods Resources */,
B5388EC5A25E89021740B916 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -178,14 +178,14 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
B5388EC5A25E89021740B916 /* Embed Pods Frameworks */ = {
B5388EC5A25E89021740B916 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -193,14 +193,14 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RouteGuideClient/Pods-RouteGuideClient-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C6FC30AD2376EC04317237C5 /* Check Pods Manifest.lock */ = {
C6FC30AD2376EC04317237C5 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -208,14 +208,14 @@
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
FFE0BCF30339E7A50A989EAB /* Copy Pods Resources */ = {
FFE0BCF30339E7A50A989EAB /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;

@ -193,7 +193,7 @@ class ClientContext {
///
/// \return A multimap of initial metadata key-value pairs from the server.
const std::multimap<grpc::string_ref, grpc::string_ref>&
GetServerInitialMetadata() {
GetServerInitialMetadata() const {
GPR_CODEGEN_ASSERT(initial_metadata_received_);
return recv_initial_metadata_;
}
@ -205,7 +205,7 @@ class ClientContext {
///
/// \return A multimap of metadata trailing key-value pairs from the server.
const std::multimap<grpc::string_ref, grpc::string_ref>&
GetServerTrailingMetadata() {
GetServerTrailingMetadata() const {
// TODO(yangg) check finished
return trailing_metadata_;
}
@ -230,13 +230,13 @@ class ClientContext {
#ifndef GRPC_CXX0X_NO_CHRONO
/// Return the deadline for the client call.
std::chrono::system_clock::time_point deadline() {
std::chrono::system_clock::time_point deadline() const {
return Timespec2Timepoint(deadline_);
}
#endif // !GRPC_CXX0X_NO_CHRONO
/// Return a \a gpr_timespec representation of the client call's deadline.
gpr_timespec raw_deadline() { return deadline_; }
gpr_timespec raw_deadline() const { return deadline_; }
/// Set the per call authority header (see
/// https://tools.ietf.org/html/rfc7540#section-8.1.2.3).
@ -337,7 +337,7 @@ class ClientContext {
const InputMessage& request,
OutputMessage* result);
grpc_call* call() { return call_; }
grpc_call* call() const { return call_; }
void set_call(grpc_call* call, const std::shared_ptr<Channel>& channel);
uint32_t initial_metadata_flags() const {

@ -94,12 +94,12 @@ class ServerContext {
~ServerContext();
#ifndef GRPC_CXX0X_NO_CHRONO
std::chrono::system_clock::time_point deadline() {
std::chrono::system_clock::time_point deadline() const {
return Timespec2Timepoint(deadline_);
}
#endif // !GRPC_CXX0X_NO_CHRONO
gpr_timespec raw_deadline() { return deadline_; }
gpr_timespec raw_deadline() const { return deadline_; }
void AddInitialMetadata(const grpc::string& key, const grpc::string& value);
void AddTrailingMetadata(const grpc::string& key, const grpc::string& value);
@ -122,7 +122,8 @@ class ServerContext {
// was called.
void TryCancel() const;
const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata() {
const std::multimap<grpc::string_ref, grpc::string_ref>& client_metadata()
const {
return client_metadata_;
}

@ -333,22 +333,28 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor *service) {
out->Indent();
// constructors
out->Print("/// <summary>Creates a new client for $servicename$</summary>\n"
"/// <param name=\"channel\">The channel to use to make remote calls.</param>\n",
"servicename", GetServiceClassName(service));
out->Print("public $name$(Channel channel) : base(channel)\n",
"name", GetClientClassName(service));
out->Print("{\n");
out->Print("}\n");
out->Print("/// <summary>Creates a new client for $servicename$ that uses a custom <c>CallInvoker</c>.</summary>\n"
"/// <param name=\"callInvoker\">The callInvoker to use to make remote calls.</param>\n",
"servicename", GetServiceClassName(service));
out->Print("public $name$(CallInvoker callInvoker) : base(callInvoker)\n",
"name", GetClientClassName(service));
out->Print("{\n");
out->Print("}\n");
out->Print("///<summary>Protected parameterless constructor to allow creation"
out->Print("/// <summary>Protected parameterless constructor to allow creation"
" of test doubles.</summary>\n");
out->Print("protected $name$() : base()\n",
"name", GetClientClassName(service));
out->Print("{\n");
out->Print("}\n");
out->Print("///<summary>Protected constructor to allow creation of configured"
" clients.</summary>\n");
out->Print("/// <summary>Protected constructor to allow creation of configured clients.</summary>\n"
"/// <param name=\"configuration\">The client configuration.</param>\n");
out->Print("protected $name$(ClientBaseConfiguration configuration)"
" : base(configuration)\n",
"name", GetClientClassName(service));
@ -485,20 +491,6 @@ void GenerateBindServiceMethod(Printer* out, const ServiceDescriptor *service) {
out->Print("\n");
}
void GenerateNewStubMethods(Printer* out, const ServiceDescriptor *service) {
out->Print("/// <summary>Creates a new client for $servicename$</summary>\n",
"servicename", GetServiceClassName(service));
out->Print("public static $classname$ NewClient(Channel channel)\n",
"classname", GetClientClassName(service));
out->Print("{\n");
out->Indent();
out->Print("return new $classname$(channel);\n", "classname",
GetClientClassName(service));
out->Outdent();
out->Print("}\n");
out->Print("\n");
}
void GenerateService(Printer* out, const ServiceDescriptor *service,
bool generate_client, bool generate_server,
bool internal_access) {
@ -524,7 +516,6 @@ void GenerateService(Printer* out, const ServiceDescriptor *service,
}
if (generate_client) {
GenerateClientStub(out, service);
GenerateNewStubMethods(out, service);
}
if (generate_server) {
GenerateBindServiceMethod(out, service);

@ -264,6 +264,7 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
t->parsing.is_client = is_client;
t->parsing.deframe_state =
is_client ? GRPC_DTS_FH_0 : GRPC_DTS_CLIENT_PREFIX_0;
t->parsing.is_first_frame = true;
t->writing.is_client = is_client;
t->optional_drop_message = gpr_empty_slice();
grpc_connectivity_state_init(
@ -643,8 +644,7 @@ static void finish_global_actions(grpc_exec_ctx *exec_ctx,
for (;;) {
if (!t->executor.writing_active && !t->closed &&
grpc_chttp2_unlocking_check_writes(exec_ctx, &t->global, &t->writing,
t->executor.parsing_active)) {
grpc_chttp2_unlocking_check_writes(exec_ctx, &t->global, &t->writing)) {
t->executor.writing_active = 1;
REF_TRANSPORT(t, "writing");
prevent_endpoint_shutdown(t);
@ -1093,6 +1093,7 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx,
stream_global->recv_trailing_metadata_finished =
add_closure_barrier(on_complete);
stream_global->recv_trailing_metadata = op->recv_trailing_metadata;
stream_global->final_metadata_requested = true;
grpc_chttp2_list_add_check_read_ops(transport_global, stream_global);
}
@ -1246,7 +1247,8 @@ static void check_read_ops(grpc_exec_ctx *exec_ctx,
stream_global->recv_initial_metadata_ready = NULL;
}
if (stream_global->recv_message_ready != NULL) {
while (stream_global->seen_error &&
while (stream_global->final_metadata_requested &&
stream_global->seen_error &&
(bs = grpc_chttp2_incoming_frame_queue_pop(
&stream_global->incoming_frames)) != NULL) {
incoming_byte_stream_destroy_locked(exec_ctx, NULL, NULL, bs);
@ -1805,7 +1807,7 @@ static void post_reading_action_locked(grpc_exec_ctx *exec_ctx,
UNREF_TRANSPORT(exec_ctx, t, "reading_action");
}
GRPC_ERROR_UNREF(error);
GRPC_LOG_IF_ERROR("close_transport", error);
}
/*******************************************************************************

@ -102,12 +102,14 @@ grpc_error *grpc_chttp2_rst_stream_parser_parse(
if (p->byte == 4) {
GPR_ASSERT(is_last);
stream_parsing->received_close = 1;
stream_parsing->forced_close_error = grpc_error_set_int(
GRPC_ERROR_CREATE("RST_STREAM"), GRPC_ERROR_INT_HTTP2_ERROR,
(intptr_t)((((uint32_t)p->reason_bytes[0]) << 24) |
(((uint32_t)p->reason_bytes[1]) << 16) |
(((uint32_t)p->reason_bytes[2]) << 8) |
(((uint32_t)p->reason_bytes[3]))));
if (stream_parsing->forced_close_error == GRPC_ERROR_NONE) {
stream_parsing->forced_close_error = grpc_error_set_int(
GRPC_ERROR_CREATE("RST_STREAM"), GRPC_ERROR_INT_HTTP2_ERROR,
(intptr_t)((((uint32_t)p->reason_bytes[0]) << 24) |
(((uint32_t)p->reason_bytes[1]) << 16) |
(((uint32_t)p->reason_bytes[2]) << 8) |
(((uint32_t)p->reason_bytes[3]))));
}
}
return GRPC_ERROR_NONE;

@ -265,6 +265,7 @@ struct grpc_chttp2_transport_parsing {
uint8_t incoming_frame_type;
uint8_t incoming_frame_flags;
uint8_t header_eof;
bool is_first_frame;
uint32_t expect_continuation_stream_id;
uint32_t incoming_frame_size;
uint32_t incoming_stream_id;
@ -440,6 +441,7 @@ typedef struct {
bool published_initial_metadata;
bool published_trailing_metadata;
bool final_metadata_requested;
grpc_chttp2_incoming_metadata_buffer received_initial_metadata;
grpc_chttp2_incoming_metadata_buffer received_trailing_metadata;
@ -524,8 +526,7 @@ struct grpc_chttp2_stream {
are required, and schedule them if so */
int grpc_chttp2_unlocking_check_writes(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport_global *global,
grpc_chttp2_transport_writing *writing,
int is_parsing);
grpc_chttp2_transport_writing *writing);
void grpc_chttp2_perform_writes(
grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_writing *transport_writing,
grpc_endpoint *endpoint);

@ -468,6 +468,17 @@ grpc_error *grpc_chttp2_perform_read(
static grpc_error *init_frame_parser(
grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_parsing *transport_parsing) {
if (transport_parsing->is_first_frame &&
transport_parsing->incoming_frame_type != GRPC_CHTTP2_FRAME_SETTINGS) {
char *msg;
gpr_asprintf(
&msg, "Expected SETTINGS frame as the first frame, got frame type %d",
transport_parsing->incoming_frame_type);
grpc_error *err = GRPC_ERROR_CREATE(msg);
gpr_free(msg);
return err;
}
transport_parsing->is_first_frame = false;
if (transport_parsing->expect_continuation_stream_id != 0) {
if (transport_parsing->incoming_frame_type !=
GRPC_CHTTP2_FRAME_CONTINUATION) {

@ -45,7 +45,7 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx,
int grpc_chttp2_unlocking_check_writes(
grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global,
grpc_chttp2_transport_writing *transport_writing, int is_parsing) {
grpc_chttp2_transport_writing *transport_writing) {
grpc_chttp2_stream_global *stream_global;
grpc_chttp2_stream_writing *stream_writing;
@ -61,7 +61,7 @@ int grpc_chttp2_unlocking_check_writes(
[GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE]);
if (transport_global->dirtied_local_settings &&
!transport_global->sent_local_settings && !is_parsing) {
!transport_global->sent_local_settings) {
gpr_slice_buffer_add(
&transport_writing->outbuf,
grpc_chttp2_settings_create(

@ -396,7 +396,7 @@ static grpc_error *add_socket_to_server(grpc_tcp_server *s, SOCKET sock,
size_t addr_len, unsigned port_index,
grpc_tcp_listener **listener) {
grpc_tcp_listener *sp = NULL;
int port;
int port = -1;
int status;
GUID guid = WSAID_ACCEPTEX;
DWORD ioctl_num_bytes;

@ -1,5 +1,7 @@
*.xproj.user
*.userprefs
*.csproj.user
*.lock.json
StyleCop.Cache
test-results
packages

@ -81,6 +81,7 @@
</ItemGroup>
<ItemGroup>
<None Include="Grpc.Auth.nuspec" />
<None Include="Grpc.Auth.project.json" />
<None Include="packages.config" />
</ItemGroup>
</Project>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>c82631ed-06d1-4458-87bc-8257d12307a8</ProjectGuid>
<RootNamespace>Grpc.Auth</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\Grpc.Core\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -0,0 +1,32 @@
{
"version": "0.15.0-dev",
"title": "gRPC C# Auth",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
"packOptions": {
"summary": "Auth library for C# implementation of gRPC - an RPC library and framework",
"description": "Auth library for C# implementation of gRPC - an RPC library and framework. See project site for more info.",
"owners": [ "grpc-packages" ],
"licenseUrl": "https://github.com/grpc/grpc/blob/master/LICENSE",
"projectUrl": "https://github.com/grpc/grpc",
"requireLicenseAcceptance": false,
"tags": [ "gRPC RPC Protocol HTTP/2 Auth OAuth2" ],
},
"dependencies": {
"Grpc.Core": "0.15.0-dev",
"Google.Apis.Auth": "1.11.1"
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"net45"
],
"dependencies": {
"Microsoft.NETCore.Portable.Compatibility": "1.0.1-rc2-24027",
"NETStandard.Library": "1.5.0-rc2-24027",
"System.Threading.Tasks": "4.0.11-rc2-24027"
}
}
}
}

@ -32,13 +32,7 @@
#endregion
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
using NUnit.Framework;
@ -46,6 +40,13 @@ namespace Grpc.Core.Tests
{
public class AppDomainUnloadTest
{
#if NETSTANDARD1_5
[Test]
[Ignore("Not supported for CoreCLR")]
public void AppDomainUnloadHookCanCleanupAbandonedCall()
{
}
#else
[Test]
public void AppDomainUnloadHookCanCleanupAbandonedCall()
{
@ -86,5 +87,6 @@ namespace Grpc.Core.Tests
readyToShutdown.Task.Wait(); // make sure handler is running
}
}
#endif
}
}

@ -34,6 +34,7 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
@ -118,5 +119,30 @@ namespace Grpc.Core.Tests
await call.ResponseStream.ToListAsync();
}
[Test]
public void CanReadCompressedMessages()
{
var compressionMetadata = new Metadata
{
{ new Metadata.Entry(Metadata.CompressionRequestAlgorithmMetadataKey, "gzip") }
};
helper.UnaryHandler = new UnaryServerMethod<string, string>(async (req, context) =>
{
await context.WriteResponseHeadersAsync(compressionMetadata);
return req;
});
var stringBuilder = new StringBuilder();
for (int i = 0; i < 200000; i++)
{
stringBuilder.Append('a');
}
var request = stringBuilder.ToString();
var response = Calls.BlockingUnaryCall(helper.CreateUnaryCall(new CallOptions(compressionMetadata)), request);
Assert.AreEqual(request, response);
}
}
}

@ -99,6 +99,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.Core.Tests.project.json" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>759e23b2-fc04-4695-902d-b073cded3599</ProjectGuid>
<RootNamespace>Grpc.Core.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -49,7 +49,7 @@ namespace Grpc.Core.Tests
{
// Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406.
GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error));
#if DOTNET5_4
#if NETSTANDARD1_5
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else
return new AutoRun().Execute(args);

@ -56,7 +56,7 @@ namespace Grpc.Core.Tests
Console.Error.WriteLine("You are using and old version of NUnit that doesn't support async tests and skips them instead. " +
"This test has failed to indicate that.");
Console.Error.Flush();
Environment.Exit(1);
throw new Exception("NUnitVersionTest has failed.");
}
}

@ -45,6 +45,8 @@ namespace Grpc.Core.Tests
{
public class SanityTest
{
// TODO: make sanity test work for CoreCLR as well
#if !NETSTANDARD1_5
/// <summary>
/// Because we depend on a native library, sometimes when things go wrong, the
/// entire NUnit test process crashes. To be able to track down problems better,
@ -121,5 +123,6 @@ namespace Grpc.Core.Tests
}
return result;
}
#endif
}
}

@ -0,0 +1,56 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"configurations": {
"Debug": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/dbg/libgrpc_csharp_ext.dylib"
}
}
}
},
"Release": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/opt/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/opt/libgrpc_csharp_ext.dylib"
}
}
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Core": {
"target": "project"
},
"Newtonsoft.Json": "8.0.3",
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*"
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
},
}

@ -141,6 +141,7 @@
</ItemGroup>
<ItemGroup>
<None Include="Grpc.Core.nuspec" />
<None Include="Grpc.Core.project.json" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="NativeDeps.targets" />
@ -148,7 +149,7 @@
<ItemGroup />
<ItemGroup>
<EmbeddedResource Include="..\..\..\etc\roots.pem">
<Link>Resources\roots.pem</Link>
<Link>roots.pem</Link>
</EmbeddedResource>
</ItemGroup>
</Project>

@ -24,11 +24,11 @@
<file src="bin/ReleaseSigned/Grpc.Core.xml" target="lib/net45" />
<file src="**\*.cs" target="src" />
<file src="Grpc.Core.targets" target="\build\net45\Grpc.Core.targets" />
<file src="windows_x86/grpc_csharp_ext.dll" target="/build/native/bin/windows_x86/grpc_csharp_ext.dll" />
<file src="windows_x64/grpc_csharp_ext.dll" target="/build/native/bin/windows_x64/grpc_csharp_ext.dll" />
<file src="linux_x86/libgrpc_csharp_ext.so" target="/build/native/bin/linux_x86/libgrpc_csharp_ext.so" />
<file src="linux_x64/libgrpc_csharp_ext.so" target="/build/native/bin/linux_x64/libgrpc_csharp_ext.so" />
<file src="macosx_x86/libgrpc_csharp_ext.dylib" target="/build/native/bin/macosx_x86/libgrpc_csharp_ext.dylib" />
<file src="macosx_x64/libgrpc_csharp_ext.dylib" target="/build/native/bin/macosx_x64/libgrpc_csharp_ext.dylib" />
<file src="../nativelibs/windows_x86/grpc_csharp_ext.dll" target="/build/native/bin/windows_x86/grpc_csharp_ext.dll" />
<file src="../nativelibs/windows_x64/grpc_csharp_ext.dll" target="/build/native/bin/windows_x64/grpc_csharp_ext.dll" />
<file src="../nativelibs/linux_x86/libgrpc_csharp_ext.so" target="/build/native/bin/linux_x86/libgrpc_csharp_ext.so" />
<file src="../nativelibs/linux_x64/libgrpc_csharp_ext.so" target="/build/native/bin/linux_x64/libgrpc_csharp_ext.so" />
<file src="../nativelibs/macosx_x86/libgrpc_csharp_ext.dylib" target="/build/native/bin/macosx_x86/libgrpc_csharp_ext.dylib" />
<file src="../nativelibs/macosx_x64/libgrpc_csharp_ext.dylib" target="/build/native/bin/macosx_x64/libgrpc_csharp_ext.dylib" />
</files>
</package>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>dc9908b6-f291-4fc8-a46d-2ea2551790ec</ProjectGuid>
<RootNamespace>Grpc.Core</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -105,7 +105,7 @@ namespace Grpc.Core
if (instanceToShutdown != null)
{
await instanceToShutdown.ShutdownAsync();
await instanceToShutdown.ShutdownAsync().ConfigureAwait(false);
}
}
@ -352,8 +352,12 @@ namespace Grpc.Core
{
if (!hooksRegistered)
{
// TODO(jtattermusch): register shutdownhooks for CoreCLR as well
#if !NETSTANDARD1_5
AppDomain.CurrentDomain.ProcessExit += ShutdownHookHandler;
AppDomain.CurrentDomain.DomainUnload += ShutdownHookHandler;
#endif
}
hooksRegistered = true;
}

@ -46,7 +46,7 @@ namespace Grpc.Core.Internal
/// </summary>
internal static class DefaultSslRootsOverride
{
const string RootsPemResourceName = "Grpc.Core.Resources.roots.pem";
const string RootsPemResourceName = "Grpc.Core.roots.pem";
static object staticLock = new object();
/// <summary>

@ -117,8 +117,8 @@ namespace Grpc.Core.Internal
private static string GetAssemblyPath()
{
var assembly = typeof(NativeExtension).GetTypeInfo().Assembly;
#if DOTNET5_4
// Assembly.EscapedCodeBase does not exit under CoreCLR, but assemblies imported from a nuget package
#if NETSTANDARD1_5
// Assembly.EscapedCodeBase does not exist under CoreCLR, but assemblies imported from a nuget package
// don't seem to be shadowed by DNX-based projects at all.
return assembly.Location;
#else
@ -136,7 +136,7 @@ namespace Grpc.Core.Internal
#endif
}
#if !DOTNET5_4
#if !NETSTANDARD1_5
private static bool IsFileUri(string uri)
{
return uri.ToLowerInvariant().StartsWith(Uri.UriSchemeFile);

@ -53,7 +53,7 @@ namespace Grpc.Core.Internal
static PlatformApis()
{
#if DNXCORE50
#if NETSTANDARD1_5
isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
isMacOSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);

@ -39,7 +39,7 @@ namespace Grpc.Core.Internal
/// <summary>
/// Safe handle to wrap native objects.
/// </summary>
internal abstract class SafeHandleZeroIsInvalid : SafeHandle
internal abstract class SafeHandleZeroIsInvalid : System.Runtime.InteropServices.SafeHandle
{
public SafeHandleZeroIsInvalid() : base(IntPtr.Zero, true)
{

@ -63,6 +63,13 @@ namespace Grpc.Core
/// </summary>
public static readonly Metadata Empty = new Metadata().Freeze();
/// <summary>
/// To be used in initial metadata to request specific compression algorithm
/// for given call. Direct selection of compression algorithms is an internal
/// feature and is not part of public API.
/// </summary>
internal const string CompressionRequestAlgorithmMetadataKey = "grpc-internal-encoding-request";
readonly List<Entry> entries;
bool readOnly;

@ -0,0 +1,42 @@
{
"version": "0.15.0-dev",
"title": "gRPC C# Core",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
"packOptions": {
"summary": "Core C# implementation of gRPC - an RPC library and framework",
"description": "Core C# implementation of gRPC - an RPC library and framework. See project site for more info.",
"owners": [ "grpc-packages" ],
"licenseUrl": "https://github.com/grpc/grpc/blob/master/LICENSE",
"projectUrl": "https://github.com/grpc/grpc",
"requireLicenseAcceptance": false,
"tags": [ "gRPC RPC Protocol HTTP/2" ],
"files": {
"build/net45/": "Grpc.Core.targets",
"build/native/bin/windows_x86/": "../nativelibs/windows_x86/grpc_csharp_ext.dll",
"build/native/bin/windows_x64/": "../nativelibs/windows_x64/grpc_csharp_ext.dll",
"build/native/bin/linux_x86/": "../nativelibs/linux_x86/libgrpc_csharp_ext.so",
"build/native/bin/linux_x64/": "../nativelibs/linux_x64/libgrpc_csharp_ext.so",
"build/native/bin/macosx_x86/": "../nativelibs/macosx_x86/libgrpc_csharp_ext.dylib",
"build/native/bin/macosx_x64/": "../nativelibs/macosx_x64/libgrpc_csharp_ext.dylib"
}
},
"buildOptions": {
"embed": [ "../../../etc/roots.pem" ]
},
"dependencies": {
"Ix-Async": "1.2.5"
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027",
"System.Threading.Thread": "4.0.0-rc2-24027"
}
}
}
}

@ -0,0 +1,100 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.Core", "Grpc.Core\Grpc.Core.xproj", "{DC9908B6-F291-4FC8-A46D-2EA2551790EC}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.Auth", "Grpc.Auth\Grpc.Auth.xproj", "{C82631ED-06D1-4458-87BC-8257D12307A8}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.Core.Tests", "Grpc.Core.Tests\Grpc.Core.Tests.xproj", "{759E23B2-FC04-4695-902D-B073CDED3599}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.Examples", "Grpc.Examples\Grpc.Examples.xproj", "{C77B792D-FC78-4CE2-9522-B40B0803C636}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.Examples.MathClient", "Grpc.Examples.MathClient\Grpc.Examples.MathClient.xproj", "{FD48DECA-1622-4173-B1D9-2101CF5E7C5F}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.Examples.MathServer", "Grpc.Examples.MathServer\Grpc.Examples.MathServer.xproj", "{58579368-5372-4E67-ACD6-9B59CB9FA698}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.Examples.Tests", "Grpc.Examples.Tests\Grpc.Examples.Tests.xproj", "{C61714A6-F633-44FB-97F4-C91F425C1D15}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.HealthCheck", "Grpc.HealthCheck\Grpc.HealthCheck.xproj", "{3BE4AD0B-2BF0-4D68-B625-F6018EF0DCFA}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.HealthCheck.Tests", "Grpc.HealthCheck.Tests\Grpc.HealthCheck.Tests.xproj", "{43DAFAC6-5343-4621-960E-A8A977EA3F0B}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.IntegrationTesting", "Grpc.IntegrationTesting\Grpc.IntegrationTesting.xproj", "{20354386-3E71-4046-A269-3BC2A06F3EC8}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.IntegrationTesting.Client", "Grpc.IntegrationTesting.Client\Grpc.IntegrationTesting.Client.xproj", "{48EA5BBE-70E2-4198-869D-D7E59C45F30D}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.IntegrationTesting.QpsWorker", "Grpc.IntegrationTesting.QpsWorker\Grpc.IntegrationTesting.QpsWorker.xproj", "{661B70D7-F56A-46E0-9B81-6227B591B5E7}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.IntegrationTesting.Server", "Grpc.IntegrationTesting.Server\Grpc.IntegrationTesting.Server.xproj", "{881F7AD1-A84E-47A2-9402-115C63C4031E}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Grpc.IntegrationTesting.StressClient", "Grpc.IntegrationTesting.StressClient\Grpc.IntegrationTesting.StressClient.xproj", "{0EBC910B-8867-4D3E-8686-91F34183D839}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DC9908B6-F291-4FC8-A46D-2EA2551790EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC9908B6-F291-4FC8-A46D-2EA2551790EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC9908B6-F291-4FC8-A46D-2EA2551790EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC9908B6-F291-4FC8-A46D-2EA2551790EC}.Release|Any CPU.Build.0 = Release|Any CPU
{C82631ED-06D1-4458-87BC-8257D12307A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C82631ED-06D1-4458-87BC-8257D12307A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C82631ED-06D1-4458-87BC-8257D12307A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C82631ED-06D1-4458-87BC-8257D12307A8}.Release|Any CPU.Build.0 = Release|Any CPU
{759E23B2-FC04-4695-902D-B073CDED3599}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{759E23B2-FC04-4695-902D-B073CDED3599}.Debug|Any CPU.Build.0 = Debug|Any CPU
{759E23B2-FC04-4695-902D-B073CDED3599}.Release|Any CPU.ActiveCfg = Release|Any CPU
{759E23B2-FC04-4695-902D-B073CDED3599}.Release|Any CPU.Build.0 = Release|Any CPU
{C77B792D-FC78-4CE2-9522-B40B0803C636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C77B792D-FC78-4CE2-9522-B40B0803C636}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C77B792D-FC78-4CE2-9522-B40B0803C636}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C77B792D-FC78-4CE2-9522-B40B0803C636}.Release|Any CPU.Build.0 = Release|Any CPU
{FD48DECA-1622-4173-B1D9-2101CF5E7C5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD48DECA-1622-4173-B1D9-2101CF5E7C5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD48DECA-1622-4173-B1D9-2101CF5E7C5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD48DECA-1622-4173-B1D9-2101CF5E7C5F}.Release|Any CPU.Build.0 = Release|Any CPU
{58579368-5372-4E67-ACD6-9B59CB9FA698}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58579368-5372-4E67-ACD6-9B59CB9FA698}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58579368-5372-4E67-ACD6-9B59CB9FA698}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58579368-5372-4E67-ACD6-9B59CB9FA698}.Release|Any CPU.Build.0 = Release|Any CPU
{C61714A6-F633-44FB-97F4-C91F425C1D15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C61714A6-F633-44FB-97F4-C91F425C1D15}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C61714A6-F633-44FB-97F4-C91F425C1D15}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C61714A6-F633-44FB-97F4-C91F425C1D15}.Release|Any CPU.Build.0 = Release|Any CPU
{3BE4AD0B-2BF0-4D68-B625-F6018EF0DCFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BE4AD0B-2BF0-4D68-B625-F6018EF0DCFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BE4AD0B-2BF0-4D68-B625-F6018EF0DCFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BE4AD0B-2BF0-4D68-B625-F6018EF0DCFA}.Release|Any CPU.Build.0 = Release|Any CPU
{43DAFAC6-5343-4621-960E-A8A977EA3F0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43DAFAC6-5343-4621-960E-A8A977EA3F0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43DAFAC6-5343-4621-960E-A8A977EA3F0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43DAFAC6-5343-4621-960E-A8A977EA3F0B}.Release|Any CPU.Build.0 = Release|Any CPU
{20354386-3E71-4046-A269-3BC2A06F3EC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20354386-3E71-4046-A269-3BC2A06F3EC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20354386-3E71-4046-A269-3BC2A06F3EC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20354386-3E71-4046-A269-3BC2A06F3EC8}.Release|Any CPU.Build.0 = Release|Any CPU
{48EA5BBE-70E2-4198-869D-D7E59C45F30D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48EA5BBE-70E2-4198-869D-D7E59C45F30D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48EA5BBE-70E2-4198-869D-D7E59C45F30D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48EA5BBE-70E2-4198-869D-D7E59C45F30D}.Release|Any CPU.Build.0 = Release|Any CPU
{661B70D7-F56A-46E0-9B81-6227B591B5E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{661B70D7-F56A-46E0-9B81-6227B591B5E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{661B70D7-F56A-46E0-9B81-6227B591B5E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{661B70D7-F56A-46E0-9B81-6227B591B5E7}.Release|Any CPU.Build.0 = Release|Any CPU
{881F7AD1-A84E-47A2-9402-115C63C4031E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{881F7AD1-A84E-47A2-9402-115C63C4031E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{881F7AD1-A84E-47A2-9402-115C63C4031E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{881F7AD1-A84E-47A2-9402-115C63C4031E}.Release|Any CPU.Build.0 = Release|Any CPU
{0EBC910B-8867-4D3E-8686-91F34183D839}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0EBC910B-8867-4D3E-8686-91F34183D839}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0EBC910B-8867-4D3E-8686-91F34183D839}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0EBC910B-8867-4D3E-8686-91F34183D839}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

@ -57,4 +57,7 @@
<Name>Grpc.Examples</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.Examples.MathClient.project.json" />
</ItemGroup>
</Project>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>fd48deca-1622-4173-b1d9-2101cf5e7c5f</ProjectGuid>
<RootNamespace>Grpc.Examples.MathClient</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -0,0 +1,53 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"configurations": {
"Debug": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/dbg/libgrpc_csharp_ext.dylib"
}
}
}
},
"Release": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/opt/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/opt/libgrpc_csharp_ext.dylib"
}
}
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Examples": {
"target": "project"
}
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -57,4 +57,7 @@
<Name>Grpc.Examples</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.Examples.MathServer.project.json" />
</ItemGroup>
</Project>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>58579368-5372-4e67-acd6-9b59cb9fa698</ProjectGuid>
<RootNamespace>Grpc.Examples.MathServer</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -0,0 +1,53 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"configurations": {
"Debug": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/dbg/libgrpc_csharp_ext.dylib"
}
}
}
},
"Release": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/opt/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/opt/libgrpc_csharp_ext.dylib"
}
}
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Examples": {
"target": "project"
}
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -69,6 +69,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.Examples.Tests.project.json" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>c61714a6-f633-44fb-97f4-c91f425c1d15</ProjectGuid>
<RootNamespace>Grpc.Examples.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -62,7 +62,7 @@ namespace Math.Tests
};
server.Start();
channel = new Channel(Host, server.Ports.Single().BoundPort, ChannelCredentials.Insecure);
client = Math.NewClient(channel);
client = new Math.MathClient(channel);
}
[TestFixtureTearDown]
@ -110,7 +110,7 @@ namespace Math.Tests
{
var responses = await call.ResponseStream.ToListAsync();
CollectionAssert.AreEqual(new List<long> { 1, 1, 2, 3, 5, 8 },
responses.ConvertAll((n) => n.Num_));
responses.Select((n) => n.Num_));
}
}
@ -162,7 +162,7 @@ namespace Math.Tests
{
using (var call = client.Sum())
{
var numbers = new List<long> { 10, 20, 30 }.ConvertAll(n => new Num { Num_ = n });
var numbers = new List<long> { 10, 20, 30 }.Select(n => new Num { Num_ = n });
await call.RequestStream.WriteAllAsync(numbers);
var result = await call.ResponseAsync;
@ -185,8 +185,8 @@ namespace Math.Tests
await call.RequestStream.WriteAllAsync(divArgsList);
var result = await call.ResponseStream.ToListAsync();
CollectionAssert.AreEqual(new long[] { 3, 4, 3 }, result.ConvertAll((divReply) => divReply.Quotient));
CollectionAssert.AreEqual(new long[] { 1, 16, 1 }, result.ConvertAll((divReply) => divReply.Remainder));
CollectionAssert.AreEqual(new long[] { 3, 4, 3 }, result.Select((divReply) => divReply.Quotient));
CollectionAssert.AreEqual(new long[] { 1, 16, 1 }, result.Select((divReply) => divReply.Remainder));
}
}
}

@ -49,7 +49,7 @@ namespace Grpc.Examples.Tests
{
// Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406.
GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error));
#if DOTNET5_4
#if NETSTANDARD1_5
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else
return new AutoRun().Execute(args);

@ -0,0 +1,55 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"configurations": {
"Debug": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/dbg/libgrpc_csharp_ext.dylib"
}
}
}
},
"Release": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/opt/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/opt/libgrpc_csharp_ext.dylib"
}
}
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.Examples": {
"target": "project"
},
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*"
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -69,6 +69,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.Examples.project.json" />
<None Include="packages.config" />
</ItemGroup>
</Project>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>c77b792d-fc78-4ce2-9522-b40b0803c636</ProjectGuid>
<RootNamespace>Grpc.Examples</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -128,17 +128,22 @@ namespace Math {
/// <summary>Client for Math</summary>
public class MathClient : ClientBase<MathClient>
{
/// <summary>Creates a new client for Math</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public MathClient(Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for Math that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public MathClient(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>
protected MathClient() : base()
{
}
///<summary>Protected constructor to allow creation of configured clients.</summary>
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected MathClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
@ -235,12 +240,6 @@ namespace Math {
}
}
/// <summary>Creates a new client for Math</summary>
public static MathClient NewClient(Channel channel)
{
return new MathClient(channel);
}
/// <summary>Creates service definition that can be registered with a server</summary>
public static ServerServiceDefinition BindService(MathBase serviceImpl)
{

@ -0,0 +1,27 @@
{
"buildOptions": {
},
"dependencies": {
"Grpc.Core": {
"target": "project"
},
"Google.Protobuf": "3.0.0-beta3"
},
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
}
},
"netstandard1.5": {
"imports": [
"portable-net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -74,6 +74,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.HealthCheck.Tests.project.json" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>43dafac6-5343-4621-960e-a8a977ea3f0b</ProjectGuid>
<RootNamespace>Grpc.HealthCheck.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -65,7 +65,7 @@ namespace Grpc.HealthCheck.Tests
server.Start();
channel = new Channel(Host, server.Ports.Single().BoundPort, ChannelCredentials.Insecure);
client = Grpc.Health.V1.Health.NewClient(channel);
client = new Grpc.Health.V1.Health.HealthClient(channel);
}
[TestFixtureTearDown]

@ -49,7 +49,7 @@ namespace Grpc.HealthCheck.Tests
{
// Make logger immune to NUnit capturing stdout and stderr to workaround https://github.com/nunit/nunit/issues/1406.
GrpcEnvironment.SetLogger(new TextWriterLogger(Console.Error));
#if DOTNET5_4
#if NETSTANDARD1_5
return new AutoRun(typeof(NUnitMain).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
#else
return new AutoRun().Execute(args);

@ -0,0 +1,55 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"configurations": {
"Debug": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/dbg/libgrpc_csharp_ext.dylib"
}
}
}
},
"Release": {
"buildOptions": {
"copyToOutput": {
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/opt/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/opt/libgrpc_csharp_ext.dylib"
}
}
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.HealthCheck": {
"target": "project"
},
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*"
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -65,6 +65,7 @@
</ItemGroup>
<ItemGroup>
<None Include="Grpc.HealthCheck.nuspec" />
<None Include="Grpc.HealthCheck.project.json" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>3be4ad0b-2bf0-4d68-b625-f6018ef0dcfa</ProjectGuid>
<RootNamespace>Grpc.HealthCheck</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -71,17 +71,22 @@ namespace Grpc.Health.V1 {
/// <summary>Client for Health</summary>
public class HealthClient : ClientBase<HealthClient>
{
/// <summary>Creates a new client for Health</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public HealthClient(Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for Health that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public HealthClient(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>
protected HealthClient() : base()
{
}
///<summary>Protected constructor to allow creation of configured clients.</summary>
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected HealthClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
@ -108,12 +113,6 @@ namespace Grpc.Health.V1 {
}
}
/// <summary>Creates a new client for Health</summary>
public static HealthClient NewClient(Channel channel)
{
return new HealthClient(channel);
}
/// <summary>Creates service definition that can be registered with a server</summary>
public static ServerServiceDefinition BindService(HealthBase serviceImpl)
{

@ -0,0 +1,35 @@
{
"version": "0.15.0-dev",
"title": "gRPC C# Healthchecking",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
"packOptions": {
"summary": "Implementation of gRPC health service",
"description": "Example implementation of grpc.health.v1 service that can be used for health-checking.",
"owners": [ "grpc-packages" ],
"licenseUrl": "https://github.com/grpc/grpc/blob/master/LICENSE",
"projectUrl": "https://github.com/grpc/grpc",
"requireLicenseAcceptance": false,
"tags": [ "gRPC health check" ]
},
"dependencies": {
"Grpc.Core": "0.15.0-dev",
"Google.Protobuf": "3.0.0-beta3"
},
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
}
},
"netstandard1.5": {
"imports": [
"portable-net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -83,6 +83,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.IntegrationTesting.Client.project.json" />
<None Include="packages.config" />
</ItemGroup>
</Project>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>48ea5bbe-70e2-4198-869d-d7e59c45f30d</ProjectGuid>
<RootNamespace>Grpc.IntegrationTesting.Client</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -0,0 +1,56 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"configurations": {
"Debug": {
"buildOptions": {
"copyToOutput": {
"include": "data/*",
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/dbg/libgrpc_csharp_ext.dylib"
}
}
}
},
"Release": {
"buildOptions": {
"copyToOutput": {
"include": "data/*",
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/opt/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/opt/libgrpc_csharp_ext.dylib"
}
}
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.IntegrationTesting": {
"target": "project"
}
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45",
"net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -59,5 +59,6 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Grpc.IntegrationTesting.QpsWorker.project.json" />
</ItemGroup>
</Project>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>661b70d7-f56a-46e0-9b81-6227b591b5e7</ProjectGuid>
<RootNamespace>Grpc.IntegrationTesting.QpsWorker</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -0,0 +1,56 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"configurations": {
"Debug": {
"buildOptions": {
"copyToOutput": {
"include": "data/*",
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/dbg/libgrpc_csharp_ext.dylib"
}
}
}
},
"Release": {
"buildOptions": {
"copyToOutput": {
"include": "data/*",
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/opt/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/opt/libgrpc_csharp_ext.dylib"
}
}
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.IntegrationTesting": {
"target": "project"
}
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45",
"net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -83,6 +83,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.IntegrationTesting.Server.project.json" />
<None Include="packages.config" />
</ItemGroup>
</Project>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>881f7ad1-a84e-47a2-9402-115c63c4031e</ProjectGuid>
<RootNamespace>Grpc.IntegrationTesting.Server</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -0,0 +1,56 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"configurations": {
"Debug": {
"buildOptions": {
"copyToOutput": {
"include": "data/*",
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/dbg/libgrpc_csharp_ext.dylib"
}
}
}
},
"Release": {
"buildOptions": {
"copyToOutput": {
"include": "data/*",
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/opt/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/opt/libgrpc_csharp_ext.dylib"
}
}
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.IntegrationTesting": {
"target": "project"
}
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45",
"net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -57,4 +57,7 @@
<Name>Grpc.IntegrationTesting</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.IntegrationTesting.StressClient.project.json" />
</ItemGroup>
</Project>

@ -0,0 +1,8 @@
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25123" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25123</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>0ebc910b-8867-4d3e-8686-91f34183d839</ProjectGuid>
<RootNamespace>Grpc.IntegrationTesting.StressClient</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

@ -0,0 +1,56 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"configurations": {
"Debug": {
"buildOptions": {
"copyToOutput": {
"include": "data/*",
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/dbg/libgrpc_csharp_ext.dylib"
}
}
}
},
"Release": {
"buildOptions": {
"copyToOutput": {
"include": "data/*",
"mappings": {
"nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"nativelibs/windows_x86/grpc_csharp_ext.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"nativelibs/linux_x64/libgrpc_csharp_ext.so": "../../../libs/opt/libgrpc_csharp_ext.so",
"nativelibs/macosx_x64/libgrpc_csharp_ext.dylib": "../../../libs/opt/libgrpc_csharp_ext.dylib"
}
}
}
}
},
"runtimes": {
"win7-x64": { },
"debian.8-x64": { },
"osx.10.11-x64": { }
},
"dependencies": {
"Grpc.IntegrationTesting": {
"target": "project"
}
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"imports": [
"portable-net45",
"net45"
],
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
}
}
}
}

@ -211,7 +211,7 @@ namespace Grpc.IntegrationTesting
bool profilerReset = false;
var client = BenchmarkService.NewClient(channel);
var client = new BenchmarkService.BenchmarkServiceClient(channel);
var request = CreateSimpleRequest();
var stopwatch = new Stopwatch();
@ -237,7 +237,7 @@ namespace Grpc.IntegrationTesting
private async Task RunUnaryAsync(Channel channel, IInterarrivalTimer timer)
{
var client = BenchmarkService.NewClient(channel);
var client = new BenchmarkService.BenchmarkServiceClient(channel);
var request = CreateSimpleRequest();
var stopwatch = new Stopwatch();
@ -256,7 +256,7 @@ namespace Grpc.IntegrationTesting
private async Task RunStreamingPingPongAsync(Channel channel, IInterarrivalTimer timer)
{
var client = BenchmarkService.NewClient(channel);
var client = new BenchmarkService.BenchmarkServiceClient(channel);
var request = CreateSimpleRequest();
var stopwatch = new Stopwatch();

@ -40,7 +40,6 @@ using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Utils;
using Grpc.Testing;
using Moq;
using NUnit.Framework;
namespace Grpc.IntegrationTesting
@ -49,14 +48,16 @@ namespace Grpc.IntegrationTesting
{
TestService.TestServiceClient unimplementedClient = new UnimplementedTestServiceClient();
// TODO: replace Moq by some mocking library with CoreCLR support.
#if !NETSTANDARD1_5
[Test]
public void ExpandedParamOverloadCanBeMocked()
{
var expected = new SimpleResponse();
var mockClient = new Mock<TestService.TestServiceClient>();
var mockClient = new Moq.Mock<TestService.TestServiceClient>();
// mocking is relatively clumsy because one needs to specify value for all the optional params.
mockClient.Setup(m => m.UnaryCall(It.IsAny<SimpleRequest>(), null, null, CancellationToken.None)).Returns(expected);
mockClient.Setup(m => m.UnaryCall(Moq.It.IsAny<SimpleRequest>(), null, null, CancellationToken.None)).Returns(expected);
Assert.AreSame(expected, mockClient.Object.UnaryCall(new SimpleRequest()));
}
@ -66,11 +67,12 @@ namespace Grpc.IntegrationTesting
{
var expected = new SimpleResponse();
var mockClient = new Mock<TestService.TestServiceClient>();
mockClient.Setup(m => m.UnaryCall(It.IsAny<SimpleRequest>(), It.IsAny<CallOptions>())).Returns(expected);
var mockClient = new Moq.Mock<TestService.TestServiceClient>();
mockClient.Setup(m => m.UnaryCall(Moq.It.IsAny<SimpleRequest>(), Moq.It.IsAny<CallOptions>())).Returns(expected);
Assert.AreSame(expected, mockClient.Object.UnaryCall(new SimpleRequest(), new CallOptions()));
}
#endif
[Test]
public void DefaultMethodStubThrows_UnaryCall()

@ -40,7 +40,6 @@ using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Utils;
using Grpc.Testing;
using Moq;
using NUnit.Framework;
namespace Grpc.IntegrationTesting
@ -62,7 +61,7 @@ namespace Grpc.IntegrationTesting
};
server.Start();
channel = new Channel(Host, server.Ports.Single().BoundPort, ChannelCredentials.Insecure);
client = TestService.NewClient(channel);
client = new TestService.TestServiceClient(channel);
}
[TearDown]

@ -129,6 +129,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Grpc.IntegrationTesting.project.json" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>

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

Loading…
Cancel
Save