mirror of https://github.com/grpc/grpc.git
commit
3a2ef9ded1
1114 changed files with 70725 additions and 20961 deletions
@ -1,32 +1,67 @@ |
|||||||
language: objective-c |
language: objective-c |
||||||
osx_image: xcode7.2 |
osx_image: xcode7.3 |
||||||
env: |
env: |
||||||
global: |
global: |
||||||
- CONFIG=opt |
- CONFIG=opt |
||||||
- TEST=objc |
- TEST=objc |
||||||
- JOBS=1 |
- JOBS=1 |
||||||
|
matrix: |
||||||
|
- SCHEME="RxLibraryUnitTests" WORKSPACE="Tests.xcworkspace" |
||||||
|
TEST_PATH="src/objective-c/tests" BUILD_ONLY="false" |
||||||
|
INTEROP_SERVER="false" |
||||||
|
- SCHEME="InteropTestsLocalSSL" WORKSPACE="Tests.xcworkspace" |
||||||
|
TEST_PATH="src/objective-c/tests" BUILD_ONLY="false" INTEROP_SERVER="true" |
||||||
|
- SCHEME="InteropTestsLocalCleartext" WORKSPACE="Tests.xcworkspace" |
||||||
|
TEST_PATH="src/objective-c/tests" BUILD_ONLY="false" |
||||||
|
INTEROP_SERVER="true" |
||||||
|
# TODO(jcanizales): Investigate why they time out: |
||||||
|
# - SCHEME="InteropTestsRemote" WORKSPACE="Tests.xcworkspace" |
||||||
|
# TEST_PATH="src/objective-c/tests" BUILD_ONLY="false" |
||||||
|
# INTEROP_SERVER="true" |
||||||
|
- SCHEME="HelloWorld" WORKSPACE="HelloWorld.xcworkspace" |
||||||
|
TEST_PATH="examples/objective-c/helloworld" BUILD_ONLY="true" |
||||||
|
INTEROP_SERVER="false" |
||||||
|
- SCHEME="RouteGuideClient" WORKSPACE="RouteGuideClient.xcworkspace" |
||||||
|
TEST_PATH="examples/objective-c/route_guide" BUILD_ONLY="true" |
||||||
|
INTEROP_SERVER="false" |
||||||
|
- SCHEME="AuthSample" WORKSPACE="AuthSample.xcworkspace" |
||||||
|
TEST_PATH="examples/objective-c/auth_sample" BUILD_ONLY="true" |
||||||
|
INTEROP_SERVER="false" |
||||||
|
- SCHEME="Sample" WORKSPACE="Sample.xcworkspace" |
||||||
|
TEST_PATH="src/objective-c/examples/Sample" BUILD_ONLY="true" |
||||||
|
INTEROP_SERVER="false" |
||||||
|
- SCHEME="SwiftSample" WORKSPACE="SwiftSample.xcworkspace" |
||||||
|
TEST_PATH="src/objective-c/examples/SwiftSample" BUILD_ONLY="true" |
||||||
|
INTEROP_SERVER="false" |
||||||
before_install: |
before_install: |
||||||
|
- pod --version |
||||||
|
- gem uninstall cocoapods -a |
||||||
|
- gem install cocoapods -v '1.0.0' |
||||||
|
- pod --version |
||||||
- brew install gflags |
- brew install gflags |
||||||
# Pod install does this too, but we don't want the output. |
- pushd third_party/protobuf |
||||||
- pod repo update --silent |
- git checkout v3.0.0-beta-3 |
||||||
|
- popd |
||||||
install: |
install: |
||||||
- make grpc_objective_c_plugin |
- make grpc_objective_c_plugin |
||||||
- pushd src/objective-c/tests |
- install bins/opt/grpc_objective_c_plugin /usr/local/bin/protoc-gen-objcgrpc |
||||||
# Needs to be verbose, or otherwise OpenSSL's prepare_command makes Travis |
- install bins/opt/protobuf/protoc /usr/local/bin/protoc |
||||||
# time out: |
- pushd $TEST_PATH |
||||||
- pod install --verbose |
- pod install |
||||||
- popd |
- popd |
||||||
before_script: |
before_script: |
||||||
- make interop_server |
- if [ "${INTEROP_SERVER}" = "true" ]; then |
||||||
- bins/$CONFIG/interop_server --port=5050 & |
make interop_server; |
||||||
- bins/$CONFIG/interop_server --port=5051 --use_tls & |
(bins/$CONFIG/interop_server --port=5050 &); |
||||||
xcode_workspace: src/objective-c/tests/Tests.xcworkspace |
(bins/$CONFIG/interop_server --port=5051 --use_tls &); |
||||||
xcode_scheme: |
fi |
||||||
- RxLibraryUnitTests |
script: |
||||||
- InteropTestsLocalSSL |
- if [ "${BUILD_ONLY}" = "true" ]; then |
||||||
- InteropTestsLocalCleartext |
xctool -workspace "$TEST_PATH/$WORKSPACE" -scheme "$SCHEME" |
||||||
# TODO(jcanizales): Investigate why they time out: |
-sdk iphonesimulator9.3 build; |
||||||
# - InteropTestsRemote |
else |
||||||
xcode_sdk: iphonesimulator9.2 |
xctool -workspace "$TEST_PATH/$WORKSPACE" -scheme "$SCHEME" |
||||||
|
-sdk iphonesimulator9.3 test; |
||||||
|
fi |
||||||
notifications: |
notifications: |
||||||
email: false |
email: false |
||||||
|
@ -0,0 +1,77 @@ |
|||||||
|
# gRPC command line tool |
||||||
|
|
||||||
|
## Overview |
||||||
|
|
||||||
|
This document describes the command line tool that comes with gRPC repository. It is desireable to have command line |
||||||
|
tools written in other languages to roughly follow the same syntax and flags. |
||||||
|
|
||||||
|
At this point, the tool needs to be built from source, and it should be moved out to grpc-tools repository as a stand |
||||||
|
alone application once it is mature enough. |
||||||
|
|
||||||
|
## Core functionality |
||||||
|
|
||||||
|
The command line tool can do the following things: |
||||||
|
|
||||||
|
- Send unary rpc. |
||||||
|
- Attach metadata and display received metadata. |
||||||
|
- Handle common authentication to server. |
||||||
|
- Find the request/response types from a given proto file. |
||||||
|
- Read proto request in text form. |
||||||
|
- Read request in wire form (for protobuf messages, this means serialized binary form). |
||||||
|
- Display proto response in text form. |
||||||
|
- Write response in wire form to a file. |
||||||
|
|
||||||
|
The command line tool should support the following things: |
||||||
|
|
||||||
|
- List server services and methods through server reflection. |
||||||
|
- Infer request/response types from server reflection result. |
||||||
|
- Fine-grained auth control (such as, use this oauth token to talk to the server). |
||||||
|
- Send streaming rpc. |
||||||
|
|
||||||
|
## Code location |
||||||
|
|
||||||
|
To use the tool, you need to get the grpc repository and in the grpc directory execute |
||||||
|
|
||||||
|
``` |
||||||
|
$ make grpc_cli |
||||||
|
``` |
||||||
|
|
||||||
|
The main file can be found at |
||||||
|
https://github.com/grpc/grpc/blob/master/test/cpp/util/grpc_cli.cc |
||||||
|
|
||||||
|
## Usage |
||||||
|
|
||||||
|
### Basic usage |
||||||
|
|
||||||
|
Send a rpc to a helloworld server at `localhost:50051`: |
||||||
|
|
||||||
|
``` |
||||||
|
$ bins/opt/grpc_cli call localhost:50051 SayHello examples/protos/helloworld.proto \ |
||||||
|
"name: 'world'" --enable_ssl=false |
||||||
|
``` |
||||||
|
|
||||||
|
On success, the tool will print out |
||||||
|
|
||||||
|
``` |
||||||
|
Rpc succeeded with OK status |
||||||
|
Response: |
||||||
|
message: "Hello world" |
||||||
|
``` |
||||||
|
|
||||||
|
The `localhost:50051` part indicates the server you are connecting to. `SayHello` is (part of) the |
||||||
|
gRPC method string. Then there is the path to the proto file containing the service definition, |
||||||
|
if it is not under current directory, you can use `--proto_path` to specify a new search root. |
||||||
|
`"name: 'world'"` is the text format of the request proto message. |
||||||
|
We are not using ssl here by `--enable_ssl=false`. For information on more |
||||||
|
flags, look at the comments of `grpc_cli.cc`. |
||||||
|
|
||||||
|
### Send non-proto rpc |
||||||
|
|
||||||
|
For using gRPC with protocols other than probobuf, you will need the exact method name string |
||||||
|
and a file containing the raw bytes to be sent on the wire |
||||||
|
|
||||||
|
``` |
||||||
|
$ bins/opt/grpc_cli call localhost:50051 /helloworld.Greeter/SayHello --input_binary_file=input.bin \ |
||||||
|
--output_binary_file=output.bin |
||||||
|
``` |
||||||
|
On success, you will need to read or decode the response from the `output.bin` file. |
@ -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. |
@ -0,0 +1,91 @@ |
|||||||
|
GRPC C++ STYLE GUIDE |
||||||
|
===================== |
||||||
|
|
||||||
|
Background |
||||||
|
---------- |
||||||
|
|
||||||
|
Here we document style rules for C++ usage in the gRPC C++ bindings |
||||||
|
and tests. |
||||||
|
|
||||||
|
General |
||||||
|
------- |
||||||
|
|
||||||
|
- The majority of gRPC's C++ requirements are drawn from the [Google C++ style |
||||||
|
guide] (https://google.github.io/styleguide/cppguide.html) |
||||||
|
- However, gRPC has some additional requirements to maintain |
||||||
|
[portability] (#portability) |
||||||
|
- As in C, layout rules are defined by clang-format, and all code |
||||||
|
should be passed through clang-format. A (docker-based) script to do |
||||||
|
so is included in [tools/distrib/clang\_format\_code.sh] |
||||||
|
(../tools/distrib/clang_format_code.sh). |
||||||
|
|
||||||
|
<a name="portability"></a> |
||||||
|
Portability Restrictions |
||||||
|
------------------- |
||||||
|
|
||||||
|
gRPC supports a large number of compilers, ranging from those that are |
||||||
|
missing many key C++11 features to those that have quite detailed |
||||||
|
analysis. As a result, gRPC compiles with a high level of warnings and |
||||||
|
treat all warnings as errors. gRPC also forbids the use of some common |
||||||
|
C++11 constructs. Here are some guidelines, to be extended as needed: |
||||||
|
- Do not use range-based for. Expressions of the form |
||||||
|
```c |
||||||
|
for (auto& i: vec) { |
||||||
|
// code |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
are not allowed and should be replaced with code such as |
||||||
|
```c |
||||||
|
for (auto it = vec.begin; it != vec.end(); it++) { |
||||||
|
auto& i = *it; |
||||||
|
// code |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
- Do not use lambda of any kind (no capture, explicit capture, or |
||||||
|
default capture). Other C++ functional features such as |
||||||
|
`std::function` or `std::bind` are allowed |
||||||
|
- Do not use brace-list initializers. |
||||||
|
- Do not compare a pointer to `nullptr` . This is because gcc 4.4 |
||||||
|
does not support `nullptr` directly and gRPC implements a subset of |
||||||
|
its features in [include/grpc++/impl/codegen/config.h] |
||||||
|
(../include/grpc++/impl/codegen/config.h). Instead, pointers should |
||||||
|
be checked for validity using their implicit conversion to `bool`. |
||||||
|
In other words, use `if (p)` rather than `if (p != nullptr)` |
||||||
|
- Do not initialize global/static pointer variables to `nullptr`. Just let |
||||||
|
the compiler implicitly initialize them to `nullptr` (which it will |
||||||
|
definitely do). The reason is that `nullptr` is an actual object in |
||||||
|
our implementation rather than just a constant pointer value, so |
||||||
|
static/global constructors will be called in a potentially |
||||||
|
undesirable sequence. |
||||||
|
- Do not use `final` or `override` as these are not supported by some |
||||||
|
compilers. Instead use `GRPC_FINAL` and `GRPC_OVERRIDE` . These |
||||||
|
compile down to the traditional C++ forms for compilers that support |
||||||
|
them but are just elided if the compiler does not support those features. |
||||||
|
- In the [include] (../../../tree/master/include/grpc++) and [src] |
||||||
|
(../../../tree/master/src/cpp) directory trees, you should also not |
||||||
|
use certain STL objects like `std::mutex`, `std::lock_guard`, |
||||||
|
`std::unique_lock`, `std::nullptr`, `std::thread` . Instead, use |
||||||
|
`grpc::mutex`, `grpc::lock_guard`, etc., which are gRPC |
||||||
|
implementations of the prominent features of these objects that are |
||||||
|
not always available. You can use the `std` versions of those in [test] |
||||||
|
(../../../tree/master/test/cpp) |
||||||
|
- Similarly, in the same directories, do not use `std::chrono` unless |
||||||
|
it is guarded by `#ifndef GRPC_CXX0X_NO_CHRONO` . For platforms that |
||||||
|
lack`std::chrono,` there is a C-language timer called gpr_timespec that can |
||||||
|
be used instead. |
||||||
|
- `std::unique_ptr` must be used with extreme care in any kind of |
||||||
|
collection. For example `vector<std::unique_ptr>` does not work in |
||||||
|
gcc 4.4 if the vector is constructed to its full size at |
||||||
|
initialization but does work if elements are added to the vector |
||||||
|
using functions like `push_back`. `map` and other pair-based |
||||||
|
collections do not work with `unique_ptr` under gcc 4.4. The issue |
||||||
|
is that many of these collection implementations assume a copy |
||||||
|
constructor |
||||||
|
to be available. |
||||||
|
- Don't use `std::this_thread` . Use `gpr_sleep_until` for sleeping a thread. |
||||||
|
- [Some adjacent character combinations cause problems] |
||||||
|
(https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C). If declaring a |
||||||
|
template against some class relative to the global namespace, |
||||||
|
`<::name` will be non-portable. Separate the `<` from the `:` and use `< ::name`. |
@ -0,0 +1,91 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<Scheme |
||||||
|
LastUpgradeVersion = "0730" |
||||||
|
version = "1.3"> |
||||||
|
<BuildAction |
||||||
|
parallelizeBuildables = "YES" |
||||||
|
buildImplicitDependencies = "YES"> |
||||||
|
<BuildActionEntries> |
||||||
|
<BuildActionEntry |
||||||
|
buildForTesting = "YES" |
||||||
|
buildForRunning = "YES" |
||||||
|
buildForProfiling = "YES" |
||||||
|
buildForArchiving = "YES" |
||||||
|
buildForAnalyzing = "YES"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "63E1E97B1B28CB2000EF0978" |
||||||
|
BuildableName = "AuthSample.app" |
||||||
|
BlueprintName = "AuthSample" |
||||||
|
ReferencedContainer = "container:AuthSample.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildActionEntry> |
||||||
|
</BuildActionEntries> |
||||||
|
</BuildAction> |
||||||
|
<TestAction |
||||||
|
buildConfiguration = "Debug" |
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"> |
||||||
|
<Testables> |
||||||
|
</Testables> |
||||||
|
<MacroExpansion> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "63E1E97B1B28CB2000EF0978" |
||||||
|
BuildableName = "AuthSample.app" |
||||||
|
BlueprintName = "AuthSample" |
||||||
|
ReferencedContainer = "container:AuthSample.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</MacroExpansion> |
||||||
|
<AdditionalOptions> |
||||||
|
</AdditionalOptions> |
||||||
|
</TestAction> |
||||||
|
<LaunchAction |
||||||
|
buildConfiguration = "Debug" |
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
||||||
|
launchStyle = "0" |
||||||
|
useCustomWorkingDirectory = "NO" |
||||||
|
ignoresPersistentStateOnLaunch = "NO" |
||||||
|
debugDocumentVersioning = "YES" |
||||||
|
debugServiceExtension = "internal" |
||||||
|
allowLocationSimulation = "YES"> |
||||||
|
<BuildableProductRunnable |
||||||
|
runnableDebuggingMode = "0"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "63E1E97B1B28CB2000EF0978" |
||||||
|
BuildableName = "AuthSample.app" |
||||||
|
BlueprintName = "AuthSample" |
||||||
|
ReferencedContainer = "container:AuthSample.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildableProductRunnable> |
||||||
|
<AdditionalOptions> |
||||||
|
</AdditionalOptions> |
||||||
|
</LaunchAction> |
||||||
|
<ProfileAction |
||||||
|
buildConfiguration = "Release" |
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES" |
||||||
|
savedToolIdentifier = "" |
||||||
|
useCustomWorkingDirectory = "NO" |
||||||
|
debugDocumentVersioning = "YES"> |
||||||
|
<BuildableProductRunnable |
||||||
|
runnableDebuggingMode = "0"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "63E1E97B1B28CB2000EF0978" |
||||||
|
BuildableName = "AuthSample.app" |
||||||
|
BlueprintName = "AuthSample" |
||||||
|
ReferencedContainer = "container:AuthSample.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildableProductRunnable> |
||||||
|
</ProfileAction> |
||||||
|
<AnalyzeAction |
||||||
|
buildConfiguration = "Debug"> |
||||||
|
</AnalyzeAction> |
||||||
|
<ArchiveAction |
||||||
|
buildConfiguration = "Release" |
||||||
|
revealArchiveInOrganizer = "YES"> |
||||||
|
</ArchiveAction> |
||||||
|
</Scheme> |
@ -0,0 +1,91 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<Scheme |
||||||
|
LastUpgradeVersion = "0730" |
||||||
|
version = "1.3"> |
||||||
|
<BuildAction |
||||||
|
parallelizeBuildables = "YES" |
||||||
|
buildImplicitDependencies = "YES"> |
||||||
|
<BuildActionEntries> |
||||||
|
<BuildActionEntry |
||||||
|
buildForTesting = "YES" |
||||||
|
buildForRunning = "YES" |
||||||
|
buildForProfiling = "YES" |
||||||
|
buildForArchiving = "YES" |
||||||
|
buildForAnalyzing = "YES"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "5E36905F1B2A23800040F884" |
||||||
|
BuildableName = "HelloWorld.app" |
||||||
|
BlueprintName = "HelloWorld" |
||||||
|
ReferencedContainer = "container:HelloWorld.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildActionEntry> |
||||||
|
</BuildActionEntries> |
||||||
|
</BuildAction> |
||||||
|
<TestAction |
||||||
|
buildConfiguration = "Debug" |
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"> |
||||||
|
<Testables> |
||||||
|
</Testables> |
||||||
|
<MacroExpansion> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "5E36905F1B2A23800040F884" |
||||||
|
BuildableName = "HelloWorld.app" |
||||||
|
BlueprintName = "HelloWorld" |
||||||
|
ReferencedContainer = "container:HelloWorld.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</MacroExpansion> |
||||||
|
<AdditionalOptions> |
||||||
|
</AdditionalOptions> |
||||||
|
</TestAction> |
||||||
|
<LaunchAction |
||||||
|
buildConfiguration = "Debug" |
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
||||||
|
launchStyle = "0" |
||||||
|
useCustomWorkingDirectory = "NO" |
||||||
|
ignoresPersistentStateOnLaunch = "NO" |
||||||
|
debugDocumentVersioning = "YES" |
||||||
|
debugServiceExtension = "internal" |
||||||
|
allowLocationSimulation = "YES"> |
||||||
|
<BuildableProductRunnable |
||||||
|
runnableDebuggingMode = "0"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "5E36905F1B2A23800040F884" |
||||||
|
BuildableName = "HelloWorld.app" |
||||||
|
BlueprintName = "HelloWorld" |
||||||
|
ReferencedContainer = "container:HelloWorld.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildableProductRunnable> |
||||||
|
<AdditionalOptions> |
||||||
|
</AdditionalOptions> |
||||||
|
</LaunchAction> |
||||||
|
<ProfileAction |
||||||
|
buildConfiguration = "Release" |
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES" |
||||||
|
savedToolIdentifier = "" |
||||||
|
useCustomWorkingDirectory = "NO" |
||||||
|
debugDocumentVersioning = "YES"> |
||||||
|
<BuildableProductRunnable |
||||||
|
runnableDebuggingMode = "0"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "5E36905F1B2A23800040F884" |
||||||
|
BuildableName = "HelloWorld.app" |
||||||
|
BlueprintName = "HelloWorld" |
||||||
|
ReferencedContainer = "container:HelloWorld.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildableProductRunnable> |
||||||
|
</ProfileAction> |
||||||
|
<AnalyzeAction |
||||||
|
buildConfiguration = "Debug"> |
||||||
|
</AnalyzeAction> |
||||||
|
<ArchiveAction |
||||||
|
buildConfiguration = "Release" |
||||||
|
revealArchiveInOrganizer = "YES"> |
||||||
|
</ArchiveAction> |
||||||
|
</Scheme> |
@ -0,0 +1,91 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<Scheme |
||||||
|
LastUpgradeVersion = "0730" |
||||||
|
version = "1.3"> |
||||||
|
<BuildAction |
||||||
|
parallelizeBuildables = "YES" |
||||||
|
buildImplicitDependencies = "YES"> |
||||||
|
<BuildActionEntries> |
||||||
|
<BuildActionEntry |
||||||
|
buildForTesting = "YES" |
||||||
|
buildForRunning = "YES" |
||||||
|
buildForProfiling = "YES" |
||||||
|
buildForArchiving = "YES" |
||||||
|
buildForAnalyzing = "YES"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "6325277C1B1D0395003073D9" |
||||||
|
BuildableName = "RouteGuideClient.app" |
||||||
|
BlueprintName = "RouteGuideClient" |
||||||
|
ReferencedContainer = "container:RouteGuideClient.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildActionEntry> |
||||||
|
</BuildActionEntries> |
||||||
|
</BuildAction> |
||||||
|
<TestAction |
||||||
|
buildConfiguration = "Debug" |
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"> |
||||||
|
<Testables> |
||||||
|
</Testables> |
||||||
|
<MacroExpansion> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "6325277C1B1D0395003073D9" |
||||||
|
BuildableName = "RouteGuideClient.app" |
||||||
|
BlueprintName = "RouteGuideClient" |
||||||
|
ReferencedContainer = "container:RouteGuideClient.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</MacroExpansion> |
||||||
|
<AdditionalOptions> |
||||||
|
</AdditionalOptions> |
||||||
|
</TestAction> |
||||||
|
<LaunchAction |
||||||
|
buildConfiguration = "Debug" |
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" |
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" |
||||||
|
launchStyle = "0" |
||||||
|
useCustomWorkingDirectory = "NO" |
||||||
|
ignoresPersistentStateOnLaunch = "NO" |
||||||
|
debugDocumentVersioning = "YES" |
||||||
|
debugServiceExtension = "internal" |
||||||
|
allowLocationSimulation = "YES"> |
||||||
|
<BuildableProductRunnable |
||||||
|
runnableDebuggingMode = "0"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "6325277C1B1D0395003073D9" |
||||||
|
BuildableName = "RouteGuideClient.app" |
||||||
|
BlueprintName = "RouteGuideClient" |
||||||
|
ReferencedContainer = "container:RouteGuideClient.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildableProductRunnable> |
||||||
|
<AdditionalOptions> |
||||||
|
</AdditionalOptions> |
||||||
|
</LaunchAction> |
||||||
|
<ProfileAction |
||||||
|
buildConfiguration = "Release" |
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES" |
||||||
|
savedToolIdentifier = "" |
||||||
|
useCustomWorkingDirectory = "NO" |
||||||
|
debugDocumentVersioning = "YES"> |
||||||
|
<BuildableProductRunnable |
||||||
|
runnableDebuggingMode = "0"> |
||||||
|
<BuildableReference |
||||||
|
BuildableIdentifier = "primary" |
||||||
|
BlueprintIdentifier = "6325277C1B1D0395003073D9" |
||||||
|
BuildableName = "RouteGuideClient.app" |
||||||
|
BlueprintName = "RouteGuideClient" |
||||||
|
ReferencedContainer = "container:RouteGuideClient.xcodeproj"> |
||||||
|
</BuildableReference> |
||||||
|
</BuildableProductRunnable> |
||||||
|
</ProfileAction> |
||||||
|
<AnalyzeAction |
||||||
|
buildConfiguration = "Debug"> |
||||||
|
</AnalyzeAction> |
||||||
|
<ArchiveAction |
||||||
|
buildConfiguration = "Release" |
||||||
|
revealArchiveInOrganizer = "YES"> |
||||||
|
</ArchiveAction> |
||||||
|
</Scheme> |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,57 @@ |
|||||||
|
/*
|
||||||
|
* |
||||||
|
* Copyright 2016, Google Inc. |
||||||
|
* All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are |
||||||
|
* met: |
||||||
|
* |
||||||
|
* * Redistributions of source code must retain the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer. |
||||||
|
* * Redistributions in binary form must reproduce the above |
||||||
|
* copyright notice, this list of conditions and the following disclaimer |
||||||
|
* in the documentation and/or other materials provided with the |
||||||
|
* distribution. |
||||||
|
* * Neither the name of Google Inc. nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* |
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
#ifndef GRPCXX_CREATE_CHANNEL_POSIX_H |
||||||
|
#define GRPCXX_CREATE_CHANNEL_POSIX_H |
||||||
|
|
||||||
|
#include <memory> |
||||||
|
|
||||||
|
#include <grpc++/channel.h> |
||||||
|
#include <grpc/support/port_platform.h> |
||||||
|
|
||||||
|
namespace grpc { |
||||||
|
|
||||||
|
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD |
||||||
|
|
||||||
|
/// Create a new \a Channel communicating over given file descriptor
|
||||||
|
///
|
||||||
|
/// \param target The name of the target.
|
||||||
|
/// \param fd The file descriptor representing a socket.
|
||||||
|
std::shared_ptr<Channel> CreateInsecureChannelFromFd(const grpc::string& target, |
||||||
|
int fd); |
||||||
|
|
||||||
|
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
|
||||||
|
|
||||||
|
} // namespace grpc
|
||||||
|
|
||||||
|
#endif // GRPCXX_CREATE_CHANNEL_POSIX_H
|
@ -0,0 +1,69 @@ |
|||||||
|
/*
|
||||||
|
* |
||||||
|
* Copyright 2015, Google Inc. |
||||||
|
* All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are |
||||||
|
* met: |
||||||
|
* |
||||||
|
* * Redistributions of source code must retain the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer. |
||||||
|
* * Redistributions in binary form must reproduce the above |
||||||
|
* copyright notice, this list of conditions and the following disclaimer |
||||||
|
* in the documentation and/or other materials provided with the |
||||||
|
* distribution. |
||||||
|
* * Neither the name of Google Inc. nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* |
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
#ifndef GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H |
||||||
|
#define GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H |
||||||
|
|
||||||
|
#include <grpc++/impl/server_builder_plugin.h> |
||||||
|
#include <grpc++/support/config.h> |
||||||
|
|
||||||
|
namespace grpc { |
||||||
|
class ServerInitializer; |
||||||
|
class ProtoServerReflection; |
||||||
|
} // namespace grpc
|
||||||
|
|
||||||
|
namespace grpc { |
||||||
|
namespace reflection { |
||||||
|
|
||||||
|
class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin { |
||||||
|
public: |
||||||
|
ProtoServerReflectionPlugin(); |
||||||
|
::grpc::string name() GRPC_OVERRIDE; |
||||||
|
void InitServer(::grpc::ServerInitializer* si) GRPC_OVERRIDE; |
||||||
|
void Finish(::grpc::ServerInitializer* si) GRPC_OVERRIDE; |
||||||
|
void ChangeArguments(const ::grpc::string& name, void* value) GRPC_OVERRIDE; |
||||||
|
bool has_async_methods() const GRPC_OVERRIDE; |
||||||
|
bool has_sync_methods() const GRPC_OVERRIDE; |
||||||
|
|
||||||
|
private: |
||||||
|
std::shared_ptr<grpc::ProtoServerReflection> reflection_service_; |
||||||
|
}; |
||||||
|
|
||||||
|
// Add proto reflection plugin to ServerBuilder. This function should be called
|
||||||
|
// at the static initialization time.
|
||||||
|
void InitProtoReflectionServerBuilderPlugin(); |
||||||
|
|
||||||
|
} // namespace reflection
|
||||||
|
} // namespace grpc
|
||||||
|
|
||||||
|
#endif // GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H
|
@ -0,0 +1,184 @@ |
|||||||
|
/*
|
||||||
|
* |
||||||
|
* Copyright 2015, Google Inc. |
||||||
|
* All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are |
||||||
|
* met: |
||||||
|
* |
||||||
|
* * Redistributions of source code must retain the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer. |
||||||
|
* * Redistributions in binary form must reproduce the above |
||||||
|
* copyright notice, this list of conditions and the following disclaimer |
||||||
|
* in the documentation and/or other materials provided with the |
||||||
|
* distribution. |
||||||
|
* * Neither the name of Google Inc. nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* |
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
|
||||||
|
// Generated by the gRPC protobuf plugin.
|
||||||
|
// If you make any local change, they will be lost.
|
||||||
|
// source: reflection.proto
|
||||||
|
// Original file comments:
|
||||||
|
// Copyright 2016, Google Inc.
|
||||||
|
// All rights reserved.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
//
|
||||||
|
// Service exported by server reflection
|
||||||
|
//
|
||||||
|
#ifndef GRPC_reflection_2eproto__INCLUDED |
||||||
|
#define GRPC_reflection_2eproto__INCLUDED |
||||||
|
|
||||||
|
#include <grpc++/ext/reflection.pb.h> |
||||||
|
|
||||||
|
#include <grpc++/impl/codegen/async_stream.h> |
||||||
|
#include <grpc++/impl/codegen/async_unary_call.h> |
||||||
|
#include <grpc++/impl/codegen/proto_utils.h> |
||||||
|
#include <grpc++/impl/codegen/rpc_method.h> |
||||||
|
#include <grpc++/impl/codegen/service_type.h> |
||||||
|
#include <grpc++/impl/codegen/status.h> |
||||||
|
#include <grpc++/impl/codegen/stub_options.h> |
||||||
|
#include <grpc++/impl/codegen/sync_stream.h> |
||||||
|
|
||||||
|
namespace grpc { |
||||||
|
class CompletionQueue; |
||||||
|
class Channel; |
||||||
|
class RpcService; |
||||||
|
class ServerCompletionQueue; |
||||||
|
class ServerContext; |
||||||
|
} // namespace grpc
|
||||||
|
|
||||||
|
namespace grpc { |
||||||
|
namespace reflection { |
||||||
|
namespace v1alpha { |
||||||
|
|
||||||
|
class ServerReflection GRPC_FINAL { |
||||||
|
public: |
||||||
|
class StubInterface { |
||||||
|
public: |
||||||
|
virtual ~StubInterface() {} |
||||||
|
// The reflection service is structured as a bidirectional stream, ensuring
|
||||||
|
// all related requests go to a single server.
|
||||||
|
std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> ServerReflectionInfo(::grpc::ClientContext* context) { |
||||||
|
return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(ServerReflectionInfoRaw(context)); |
||||||
|
} |
||||||
|
std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> AsyncServerReflectionInfo(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { |
||||||
|
return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(AsyncServerReflectionInfoRaw(context, cq, tag)); |
||||||
|
} |
||||||
|
private: |
||||||
|
virtual ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflectionInfoRaw(::grpc::ClientContext* context) = 0; |
||||||
|
virtual ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; |
||||||
|
}; |
||||||
|
class Stub GRPC_FINAL : public StubInterface { |
||||||
|
public: |
||||||
|
Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); |
||||||
|
std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> ServerReflectionInfo(::grpc::ClientContext* context) { |
||||||
|
return std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(ServerReflectionInfoRaw(context)); |
||||||
|
} |
||||||
|
std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> AsyncServerReflectionInfo(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { |
||||||
|
return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(AsyncServerReflectionInfoRaw(context, cq, tag)); |
||||||
|
} |
||||||
|
|
||||||
|
private: |
||||||
|
std::shared_ptr< ::grpc::ChannelInterface> channel_; |
||||||
|
::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflectionInfoRaw(::grpc::ClientContext* context) GRPC_OVERRIDE; |
||||||
|
::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) GRPC_OVERRIDE; |
||||||
|
const ::grpc::RpcMethod rpcmethod_ServerReflectionInfo_; |
||||||
|
}; |
||||||
|
static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); |
||||||
|
|
||||||
|
class Service : public ::grpc::Service { |
||||||
|
public: |
||||||
|
Service(); |
||||||
|
virtual ~Service(); |
||||||
|
// The reflection service is structured as a bidirectional stream, ensuring
|
||||||
|
// all related requests go to a single server.
|
||||||
|
virtual ::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream); |
||||||
|
}; |
||||||
|
template <class BaseClass> |
||||||
|
class WithAsyncMethod_ServerReflectionInfo : public BaseClass { |
||||||
|
private: |
||||||
|
void BaseClassMustBeDerivedFromService(const Service *service) {} |
||||||
|
public: |
||||||
|
WithAsyncMethod_ServerReflectionInfo() { |
||||||
|
::grpc::Service::MarkMethodAsync(0); |
||||||
|
} |
||||||
|
~WithAsyncMethod_ServerReflectionInfo() GRPC_OVERRIDE { |
||||||
|
BaseClassMustBeDerivedFromService(this); |
||||||
|
} |
||||||
|
// disable synchronous version of this method
|
||||||
|
::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) GRPC_FINAL GRPC_OVERRIDE { |
||||||
|
abort(); |
||||||
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
||||||
|
} |
||||||
|
void RequestServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
||||||
|
::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag); |
||||||
|
} |
||||||
|
}; |
||||||
|
typedef WithAsyncMethod_ServerReflectionInfo<Service > AsyncService; |
||||||
|
template <class BaseClass> |
||||||
|
class WithGenericMethod_ServerReflectionInfo : public BaseClass { |
||||||
|
private: |
||||||
|
void BaseClassMustBeDerivedFromService(const Service *service) {} |
||||||
|
public: |
||||||
|
WithGenericMethod_ServerReflectionInfo() { |
||||||
|
::grpc::Service::MarkMethodGeneric(0); |
||||||
|
} |
||||||
|
~WithGenericMethod_ServerReflectionInfo() GRPC_OVERRIDE { |
||||||
|
BaseClassMustBeDerivedFromService(this); |
||||||
|
} |
||||||
|
// disable synchronous version of this method
|
||||||
|
::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) GRPC_FINAL GRPC_OVERRIDE { |
||||||
|
abort(); |
||||||
|
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
||||||
|
} |
||||||
|
}; |
||||||
|
}; |
||||||
|
|
||||||
|
} // namespace v1alpha
|
||||||
|
} // namespace reflection
|
||||||
|
} // namespace grpc
|
||||||
|
|
||||||
|
|
||||||
|
#endif // GRPC_reflection_2eproto__INCLUDED
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,56 @@ |
|||||||
|
/*
|
||||||
|
* |
||||||
|
* Copyright 2016, Google Inc. |
||||||
|
* All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are |
||||||
|
* met: |
||||||
|
* |
||||||
|
* * Redistributions of source code must retain the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer. |
||||||
|
* * Redistributions in binary form must reproduce the above |
||||||
|
* copyright notice, this list of conditions and the following disclaimer |
||||||
|
* in the documentation and/or other materials provided with the |
||||||
|
* distribution. |
||||||
|
* * Neither the name of Google Inc. nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* |
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
#ifndef GRPCXX_SERVER_POSIX_H |
||||||
|
#define GRPCXX_SERVER_POSIX_H |
||||||
|
|
||||||
|
#include <memory> |
||||||
|
|
||||||
|
#include <grpc++/server.h> |
||||||
|
#include <grpc/support/port_platform.h> |
||||||
|
|
||||||
|
namespace grpc { |
||||||
|
|
||||||
|
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD |
||||||
|
|
||||||
|
/// Adds new client to a \a Server communicating over given file descriptor
|
||||||
|
///
|
||||||
|
/// \param server The server to add a client to.
|
||||||
|
/// \param fd The file descriptor representing a socket.
|
||||||
|
void AddInsecureChannelFromFd(Server* server, int fd); |
||||||
|
|
||||||
|
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
|
||||||
|
|
||||||
|
} // namespace grpc
|
||||||
|
|
||||||
|
#endif // GRPCXX_SERVER_POSIX_H
|
@ -0,0 +1,78 @@ |
|||||||
|
/*
|
||||||
|
* |
||||||
|
* Copyright 2016, Google Inc. |
||||||
|
* All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are |
||||||
|
* met: |
||||||
|
* |
||||||
|
* * Redistributions of source code must retain the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer. |
||||||
|
* * Redistributions in binary form must reproduce the above |
||||||
|
* copyright notice, this list of conditions and the following disclaimer |
||||||
|
* in the documentation and/or other materials provided with the |
||||||
|
* distribution. |
||||||
|
* * Neither the name of Google Inc. nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* |
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
#ifndef GRPC_GRPC_POSIX_H |
||||||
|
#define GRPC_GRPC_POSIX_H |
||||||
|
|
||||||
|
#include <grpc/impl/codegen/grpc_types.h> |
||||||
|
#include <grpc/support/port_platform.h> |
||||||
|
|
||||||
|
#include <stddef.h> |
||||||
|
|
||||||
|
#ifdef __cplusplus |
||||||
|
extern "C" { |
||||||
|
#endif |
||||||
|
|
||||||
|
/*! \mainpage GRPC Core POSIX
|
||||||
|
* |
||||||
|
* The GRPC Core POSIX library provides some POSIX-specific low-level |
||||||
|
* functionality on top of GRPC Core. |
||||||
|
*/ |
||||||
|
|
||||||
|
/** Create a client channel to 'target' using file descriptor 'fd'. The 'target'
|
||||||
|
argument will be used to indicate the name for this channel. See the comment |
||||||
|
for grpc_insecure_channel_create for description of 'args' argument. */ |
||||||
|
GRPCAPI grpc_channel *grpc_insecure_channel_create_from_fd( |
||||||
|
const char *target, int fd, const grpc_channel_args *args); |
||||||
|
|
||||||
|
/** Add the connected communication channel based on file descriptor 'fd' to the
|
||||||
|
'server'. The 'fd' must be an open file descriptor corresponding to a |
||||||
|
connected socket. The 'cq' is a completion queue that will be getting events |
||||||
|
from that descriptor. */ |
||||||
|
GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server *server, |
||||||
|
grpc_completion_queue *cq, |
||||||
|
int fd); |
||||||
|
|
||||||
|
/** GRPC Core POSIX library may internally use signals to optimize some work.
|
||||||
|
The library uses (SIGRTMIN + 2) signal by default. Use this API to instruct |
||||||
|
the library to use a different signal i.e 'signum' instead. |
||||||
|
Note: |
||||||
|
- To prevent GRPC library from using any signals, pass a 'signum' of -1 |
||||||
|
- This API is optional but if called, it MUST be called before grpc_init() */ |
||||||
|
GRPCAPI void grpc_use_signal(int signum); |
||||||
|
|
||||||
|
#ifdef __cplusplus |
||||||
|
} |
||||||
|
#endif |
||||||
|
|
||||||
|
#endif /* GRPC_GRPC_POSIX_H */ |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue