Conflicts: BUILD src/core/iomgr/tcp_server.h src/core/iomgr/tcp_server_posix.c src/core/iomgr/tcp_server_windows.c src/core/security/server_secure_chttp2.c src/core/surface/completion_queue.c src/core/surface/completion_queue.h src/core/surface/server.c test/core/end2end/tests/cancel_after_invoke.c test/core/end2end/tests/cancel_test_helpers.h tools/run_tests/tests.json vsprojects/vs2013/Grpc.makpull/1232/head
commit
0a94998826
188 changed files with 6118 additions and 3620 deletions
@ -1,567 +0,0 @@ |
||||
# GRPC Bazel BUILD file. |
||||
# This currently builds C and C++ code. |
||||
|
||||
# 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. |
||||
|
||||
licenses(["notice"]) # 3-clause BSD |
||||
|
||||
|
||||
|
||||
cc_library( |
||||
name = "gpr", |
||||
srcs = [ |
||||
"src/core/support/env.h", |
||||
"src/core/support/file.h", |
||||
"src/core/support/murmur_hash.h", |
||||
"src/core/support/string.h", |
||||
"src/core/support/string_win32.h", |
||||
"src/core/support/thd_internal.h", |
||||
"src/core/support/alloc.c", |
||||
"src/core/support/cancellable.c", |
||||
"src/core/support/cmdline.c", |
||||
"src/core/support/cpu_iphone.c", |
||||
"src/core/support/cpu_linux.c", |
||||
"src/core/support/cpu_posix.c", |
||||
"src/core/support/cpu_windows.c", |
||||
"src/core/support/env_linux.c", |
||||
"src/core/support/env_posix.c", |
||||
"src/core/support/env_win32.c", |
||||
"src/core/support/file.c", |
||||
"src/core/support/file_posix.c", |
||||
"src/core/support/file_win32.c", |
||||
"src/core/support/histogram.c", |
||||
"src/core/support/host_port.c", |
||||
"src/core/support/log.c", |
||||
"src/core/support/log_android.c", |
||||
"src/core/support/log_linux.c", |
||||
"src/core/support/log_posix.c", |
||||
"src/core/support/log_win32.c", |
||||
"src/core/support/murmur_hash.c", |
||||
"src/core/support/slice.c", |
||||
"src/core/support/slice_buffer.c", |
||||
"src/core/support/string.c", |
||||
"src/core/support/string_posix.c", |
||||
"src/core/support/string_win32.c", |
||||
"src/core/support/sync.c", |
||||
"src/core/support/sync_posix.c", |
||||
"src/core/support/sync_win32.c", |
||||
"src/core/support/thd_posix.c", |
||||
"src/core/support/thd_win32.c", |
||||
"src/core/support/time.c", |
||||
"src/core/support/time_posix.c", |
||||
"src/core/support/time_win32.c", |
||||
], |
||||
hdrs = [ |
||||
"include/grpc/support/alloc.h", |
||||
"include/grpc/support/atm.h", |
||||
"include/grpc/support/atm_gcc_atomic.h", |
||||
"include/grpc/support/atm_gcc_sync.h", |
||||
"include/grpc/support/atm_win32.h", |
||||
"include/grpc/support/cancellable_platform.h", |
||||
"include/grpc/support/cmdline.h", |
||||
"include/grpc/support/cpu.h", |
||||
"include/grpc/support/histogram.h", |
||||
"include/grpc/support/host_port.h", |
||||
"include/grpc/support/log.h", |
||||
"include/grpc/support/log_win32.h", |
||||
"include/grpc/support/port_platform.h", |
||||
"include/grpc/support/slice.h", |
||||
"include/grpc/support/slice_buffer.h", |
||||
"include/grpc/support/sync.h", |
||||
"include/grpc/support/sync_generic.h", |
||||
"include/grpc/support/sync_posix.h", |
||||
"include/grpc/support/sync_win32.h", |
||||
"include/grpc/support/thd.h", |
||||
"include/grpc/support/time.h", |
||||
"include/grpc/support/useful.h", |
||||
], |
||||
includes = [ |
||||
"include", |
||||
".", |
||||
], |
||||
deps = [ |
||||
], |
||||
) |
||||
|
||||
|
||||
|
||||
|
||||
cc_library( |
||||
name = "grpc", |
||||
srcs = [ |
||||
"src/core/httpcli/format_request.h", |
||||
"src/core/httpcli/httpcli.h", |
||||
"src/core/httpcli/httpcli_security_context.h", |
||||
"src/core/httpcli/parser.h", |
||||
"src/core/security/auth.h", |
||||
"src/core/security/base64.h", |
||||
"src/core/security/credentials.h", |
||||
"src/core/security/json_token.h", |
||||
"src/core/security/secure_endpoint.h", |
||||
"src/core/security/secure_transport_setup.h", |
||||
"src/core/security/security_context.h", |
||||
"src/core/tsi/fake_transport_security.h", |
||||
"src/core/tsi/ssl_transport_security.h", |
||||
"src/core/tsi/transport_security.h", |
||||
"src/core/tsi/transport_security_interface.h", |
||||
"src/core/channel/census_filter.h", |
||||
"src/core/channel/channel_args.h", |
||||
"src/core/channel/channel_stack.h", |
||||
"src/core/channel/child_channel.h", |
||||
"src/core/channel/client_channel.h", |
||||
"src/core/channel/client_setup.h", |
||||
"src/core/channel/connected_channel.h", |
||||
"src/core/channel/http_client_filter.h", |
||||
"src/core/channel/http_filter.h", |
||||
"src/core/channel/http_server_filter.h", |
||||
"src/core/channel/metadata_buffer.h", |
||||
"src/core/channel/noop_filter.h", |
||||
"src/core/compression/algorithm.h", |
||||
"src/core/compression/message_compress.h", |
||||
"src/core/debug/trace.h", |
||||
"src/core/iomgr/alarm.h", |
||||
"src/core/iomgr/alarm_heap.h", |
||||
"src/core/iomgr/alarm_internal.h", |
||||
"src/core/iomgr/endpoint.h", |
||||
"src/core/iomgr/endpoint_pair.h", |
||||
"src/core/iomgr/fd_posix.h", |
||||
"src/core/iomgr/iocp_windows.h", |
||||
"src/core/iomgr/iomgr.h", |
||||
"src/core/iomgr/iomgr_internal.h", |
||||
"src/core/iomgr/iomgr_posix.h", |
||||
"src/core/iomgr/pollset.h", |
||||
"src/core/iomgr/pollset_kick.h", |
||||
"src/core/iomgr/pollset_kick_posix.h", |
||||
"src/core/iomgr/pollset_kick_windows.h", |
||||
"src/core/iomgr/pollset_posix.h", |
||||
"src/core/iomgr/pollset_windows.h", |
||||
"src/core/iomgr/resolve_address.h", |
||||
"src/core/iomgr/sockaddr.h", |
||||
"src/core/iomgr/sockaddr_posix.h", |
||||
"src/core/iomgr/sockaddr_utils.h", |
||||
"src/core/iomgr/sockaddr_win32.h", |
||||
"src/core/iomgr/socket_utils_posix.h", |
||||
"src/core/iomgr/socket_windows.h", |
||||
"src/core/iomgr/tcp_client.h", |
||||
"src/core/iomgr/tcp_posix.h", |
||||
"src/core/iomgr/tcp_server.h", |
||||
"src/core/iomgr/tcp_windows.h", |
||||
"src/core/iomgr/time_averaged_stats.h", |
||||
"src/core/iomgr/wakeup_fd_pipe.h", |
||||
"src/core/iomgr/wakeup_fd_posix.h", |
||||
"src/core/json/json.h", |
||||
"src/core/json/json_common.h", |
||||
"src/core/json/json_reader.h", |
||||
"src/core/json/json_writer.h", |
||||
"src/core/statistics/census_interface.h", |
||||
"src/core/statistics/census_log.h", |
||||
"src/core/statistics/census_rpc_stats.h", |
||||
"src/core/statistics/census_tracing.h", |
||||
"src/core/statistics/hash_table.h", |
||||
"src/core/statistics/window_stats.h", |
||||
"src/core/surface/byte_buffer_queue.h", |
||||
"src/core/surface/call.h", |
||||
"src/core/surface/channel.h", |
||||
"src/core/surface/client.h", |
||||
"src/core/surface/completion_queue.h", |
||||
"src/core/surface/event_string.h", |
||||
"src/core/surface/init.h", |
||||
"src/core/surface/server.h", |
||||
"src/core/surface/surface_trace.h", |
||||
"src/core/transport/chttp2/alpn.h", |
||||
"src/core/transport/chttp2/bin_encoder.h", |
||||
"src/core/transport/chttp2/frame.h", |
||||
"src/core/transport/chttp2/frame_data.h", |
||||
"src/core/transport/chttp2/frame_goaway.h", |
||||
"src/core/transport/chttp2/frame_ping.h", |
||||
"src/core/transport/chttp2/frame_rst_stream.h", |
||||
"src/core/transport/chttp2/frame_settings.h", |
||||
"src/core/transport/chttp2/frame_window_update.h", |
||||
"src/core/transport/chttp2/hpack_parser.h", |
||||
"src/core/transport/chttp2/hpack_table.h", |
||||
"src/core/transport/chttp2/http2_errors.h", |
||||
"src/core/transport/chttp2/huffsyms.h", |
||||
"src/core/transport/chttp2/status_conversion.h", |
||||
"src/core/transport/chttp2/stream_encoder.h", |
||||
"src/core/transport/chttp2/stream_map.h", |
||||
"src/core/transport/chttp2/timeout_encoding.h", |
||||
"src/core/transport/chttp2/varint.h", |
||||
"src/core/transport/chttp2_transport.h", |
||||
"src/core/transport/metadata.h", |
||||
"src/core/transport/stream_op.h", |
||||
"src/core/transport/transport.h", |
||||
"src/core/transport/transport_impl.h", |
||||
"src/core/httpcli/format_request.c", |
||||
"src/core/httpcli/httpcli.c", |
||||
"src/core/httpcli/httpcli_security_context.c", |
||||
"src/core/httpcli/parser.c", |
||||
"src/core/security/auth.c", |
||||
"src/core/security/base64.c", |
||||
"src/core/security/credentials.c", |
||||
"src/core/security/credentials_posix.c", |
||||
"src/core/security/credentials_win32.c", |
||||
"src/core/security/factories.c", |
||||
"src/core/security/google_default_credentials.c", |
||||
"src/core/security/json_token.c", |
||||
"src/core/security/secure_endpoint.c", |
||||
"src/core/security/secure_transport_setup.c", |
||||
"src/core/security/security_context.c", |
||||
"src/core/security/server_secure_chttp2.c", |
||||
"src/core/surface/init_secure.c", |
||||
"src/core/surface/secure_channel_create.c", |
||||
"src/core/tsi/fake_transport_security.c", |
||||
"src/core/tsi/ssl_transport_security.c", |
||||
"src/core/tsi/transport_security.c", |
||||
"src/core/channel/call_op_string.c", |
||||
"src/core/channel/census_filter.c", |
||||
"src/core/channel/channel_args.c", |
||||
"src/core/channel/channel_stack.c", |
||||
"src/core/channel/child_channel.c", |
||||
"src/core/channel/client_channel.c", |
||||
"src/core/channel/client_setup.c", |
||||
"src/core/channel/connected_channel.c", |
||||
"src/core/channel/http_client_filter.c", |
||||
"src/core/channel/http_filter.c", |
||||
"src/core/channel/http_server_filter.c", |
||||
"src/core/channel/metadata_buffer.c", |
||||
"src/core/channel/noop_filter.c", |
||||
"src/core/compression/algorithm.c", |
||||
"src/core/compression/message_compress.c", |
||||
"src/core/debug/trace.c", |
||||
"src/core/iomgr/alarm.c", |
||||
"src/core/iomgr/alarm_heap.c", |
||||
"src/core/iomgr/endpoint.c", |
||||
"src/core/iomgr/endpoint_pair_posix.c", |
||||
"src/core/iomgr/endpoint_pair_windows.c", |
||||
"src/core/iomgr/fd_posix.c", |
||||
"src/core/iomgr/iocp_windows.c", |
||||
"src/core/iomgr/iomgr.c", |
||||
"src/core/iomgr/iomgr_posix.c", |
||||
"src/core/iomgr/iomgr_windows.c", |
||||
"src/core/iomgr/pollset_kick.c", |
||||
"src/core/iomgr/pollset_multipoller_with_epoll.c", |
||||
"src/core/iomgr/pollset_multipoller_with_poll_posix.c", |
||||
"src/core/iomgr/pollset_posix.c", |
||||
"src/core/iomgr/pollset_windows.c", |
||||
"src/core/iomgr/resolve_address_posix.c", |
||||
"src/core/iomgr/resolve_address_windows.c", |
||||
"src/core/iomgr/sockaddr_utils.c", |
||||
"src/core/iomgr/socket_utils_common_posix.c", |
||||
"src/core/iomgr/socket_utils_linux.c", |
||||
"src/core/iomgr/socket_utils_posix.c", |
||||
"src/core/iomgr/socket_windows.c", |
||||
"src/core/iomgr/tcp_client_posix.c", |
||||
"src/core/iomgr/tcp_client_windows.c", |
||||
"src/core/iomgr/tcp_posix.c", |
||||
"src/core/iomgr/tcp_server_posix.c", |
||||
"src/core/iomgr/tcp_server_windows.c", |
||||
"src/core/iomgr/tcp_windows.c", |
||||
"src/core/iomgr/time_averaged_stats.c", |
||||
"src/core/iomgr/wakeup_fd_eventfd.c", |
||||
"src/core/iomgr/wakeup_fd_nospecial.c", |
||||
"src/core/iomgr/wakeup_fd_pipe.c", |
||||
"src/core/iomgr/wakeup_fd_posix.c", |
||||
"src/core/json/json.c", |
||||
"src/core/json/json_reader.c", |
||||
"src/core/json/json_string.c", |
||||
"src/core/json/json_writer.c", |
||||
"src/core/statistics/census_init.c", |
||||
"src/core/statistics/census_log.c", |
||||
"src/core/statistics/census_rpc_stats.c", |
||||
"src/core/statistics/census_tracing.c", |
||||
"src/core/statistics/hash_table.c", |
||||
"src/core/statistics/window_stats.c", |
||||
"src/core/surface/byte_buffer.c", |
||||
"src/core/surface/byte_buffer_queue.c", |
||||
"src/core/surface/byte_buffer_reader.c", |
||||
"src/core/surface/call.c", |
||||
"src/core/surface/call_details.c", |
||||
"src/core/surface/call_log_batch.c", |
||||
"src/core/surface/channel.c", |
||||
"src/core/surface/channel_create.c", |
||||
"src/core/surface/client.c", |
||||
"src/core/surface/completion_queue.c", |
||||
"src/core/surface/event_string.c", |
||||
"src/core/surface/init.c", |
||||
"src/core/surface/lame_client.c", |
||||
"src/core/surface/metadata_array.c", |
||||
"src/core/surface/server.c", |
||||
"src/core/surface/server_chttp2.c", |
||||
"src/core/surface/server_create.c", |
||||
"src/core/surface/surface_trace.c", |
||||
"src/core/transport/chttp2/alpn.c", |
||||
"src/core/transport/chttp2/bin_encoder.c", |
||||
"src/core/transport/chttp2/frame_data.c", |
||||
"src/core/transport/chttp2/frame_goaway.c", |
||||
"src/core/transport/chttp2/frame_ping.c", |
||||
"src/core/transport/chttp2/frame_rst_stream.c", |
||||
"src/core/transport/chttp2/frame_settings.c", |
||||
"src/core/transport/chttp2/frame_window_update.c", |
||||
"src/core/transport/chttp2/hpack_parser.c", |
||||
"src/core/transport/chttp2/hpack_table.c", |
||||
"src/core/transport/chttp2/huffsyms.c", |
||||
"src/core/transport/chttp2/status_conversion.c", |
||||
"src/core/transport/chttp2/stream_encoder.c", |
||||
"src/core/transport/chttp2/stream_map.c", |
||||
"src/core/transport/chttp2/timeout_encoding.c", |
||||
"src/core/transport/chttp2/varint.c", |
||||
"src/core/transport/chttp2_transport.c", |
||||
"src/core/transport/metadata.c", |
||||
"src/core/transport/stream_op.c", |
||||
"src/core/transport/transport.c", |
||||
], |
||||
hdrs = [ |
||||
"include/grpc/grpc_security.h", |
||||
"include/grpc/byte_buffer.h", |
||||
"include/grpc/byte_buffer_reader.h", |
||||
"include/grpc/grpc.h", |
||||
"include/grpc/grpc_http.h", |
||||
"include/grpc/status.h", |
||||
], |
||||
includes = [ |
||||
"include", |
||||
".", |
||||
], |
||||
deps = [ |
||||
":gpr", |
||||
], |
||||
) |
||||
|
||||
|
||||
|
||||
|
||||
cc_library( |
||||
name = "grpc_unsecure", |
||||
srcs = [ |
||||
"src/core/channel/census_filter.h", |
||||
"src/core/channel/channel_args.h", |
||||
"src/core/channel/channel_stack.h", |
||||
"src/core/channel/child_channel.h", |
||||
"src/core/channel/client_channel.h", |
||||
"src/core/channel/client_setup.h", |
||||
"src/core/channel/connected_channel.h", |
||||
"src/core/channel/http_client_filter.h", |
||||
"src/core/channel/http_filter.h", |
||||
"src/core/channel/http_server_filter.h", |
||||
"src/core/channel/metadata_buffer.h", |
||||
"src/core/channel/noop_filter.h", |
||||
"src/core/compression/algorithm.h", |
||||
"src/core/compression/message_compress.h", |
||||
"src/core/debug/trace.h", |
||||
"src/core/iomgr/alarm.h", |
||||
"src/core/iomgr/alarm_heap.h", |
||||
"src/core/iomgr/alarm_internal.h", |
||||
"src/core/iomgr/endpoint.h", |
||||
"src/core/iomgr/endpoint_pair.h", |
||||
"src/core/iomgr/fd_posix.h", |
||||
"src/core/iomgr/iocp_windows.h", |
||||
"src/core/iomgr/iomgr.h", |
||||
"src/core/iomgr/iomgr_internal.h", |
||||
"src/core/iomgr/iomgr_posix.h", |
||||
"src/core/iomgr/pollset.h", |
||||
"src/core/iomgr/pollset_kick.h", |
||||
"src/core/iomgr/pollset_kick_posix.h", |
||||
"src/core/iomgr/pollset_kick_windows.h", |
||||
"src/core/iomgr/pollset_posix.h", |
||||
"src/core/iomgr/pollset_windows.h", |
||||
"src/core/iomgr/resolve_address.h", |
||||
"src/core/iomgr/sockaddr.h", |
||||
"src/core/iomgr/sockaddr_posix.h", |
||||
"src/core/iomgr/sockaddr_utils.h", |
||||
"src/core/iomgr/sockaddr_win32.h", |
||||
"src/core/iomgr/socket_utils_posix.h", |
||||
"src/core/iomgr/socket_windows.h", |
||||
"src/core/iomgr/tcp_client.h", |
||||
"src/core/iomgr/tcp_posix.h", |
||||
"src/core/iomgr/tcp_server.h", |
||||
"src/core/iomgr/tcp_windows.h", |
||||
"src/core/iomgr/time_averaged_stats.h", |
||||
"src/core/iomgr/wakeup_fd_pipe.h", |
||||
"src/core/iomgr/wakeup_fd_posix.h", |
||||
"src/core/json/json.h", |
||||
"src/core/json/json_common.h", |
||||
"src/core/json/json_reader.h", |
||||
"src/core/json/json_writer.h", |
||||
"src/core/statistics/census_interface.h", |
||||
"src/core/statistics/census_log.h", |
||||
"src/core/statistics/census_rpc_stats.h", |
||||
"src/core/statistics/census_tracing.h", |
||||
"src/core/statistics/hash_table.h", |
||||
"src/core/statistics/window_stats.h", |
||||
"src/core/surface/byte_buffer_queue.h", |
||||
"src/core/surface/call.h", |
||||
"src/core/surface/channel.h", |
||||
"src/core/surface/client.h", |
||||
"src/core/surface/completion_queue.h", |
||||
"src/core/surface/event_string.h", |
||||
"src/core/surface/init.h", |
||||
"src/core/surface/server.h", |
||||
"src/core/surface/surface_trace.h", |
||||
"src/core/transport/chttp2/alpn.h", |
||||
"src/core/transport/chttp2/bin_encoder.h", |
||||
"src/core/transport/chttp2/frame.h", |
||||
"src/core/transport/chttp2/frame_data.h", |
||||
"src/core/transport/chttp2/frame_goaway.h", |
||||
"src/core/transport/chttp2/frame_ping.h", |
||||
"src/core/transport/chttp2/frame_rst_stream.h", |
||||
"src/core/transport/chttp2/frame_settings.h", |
||||
"src/core/transport/chttp2/frame_window_update.h", |
||||
"src/core/transport/chttp2/hpack_parser.h", |
||||
"src/core/transport/chttp2/hpack_table.h", |
||||
"src/core/transport/chttp2/http2_errors.h", |
||||
"src/core/transport/chttp2/huffsyms.h", |
||||
"src/core/transport/chttp2/status_conversion.h", |
||||
"src/core/transport/chttp2/stream_encoder.h", |
||||
"src/core/transport/chttp2/stream_map.h", |
||||
"src/core/transport/chttp2/timeout_encoding.h", |
||||
"src/core/transport/chttp2/varint.h", |
||||
"src/core/transport/chttp2_transport.h", |
||||
"src/core/transport/metadata.h", |
||||
"src/core/transport/stream_op.h", |
||||
"src/core/transport/transport.h", |
||||
"src/core/transport/transport_impl.h", |
||||
"src/core/surface/init_unsecure.c", |
||||
"src/core/channel/call_op_string.c", |
||||
"src/core/channel/census_filter.c", |
||||
"src/core/channel/channel_args.c", |
||||
"src/core/channel/channel_stack.c", |
||||
"src/core/channel/child_channel.c", |
||||
"src/core/channel/client_channel.c", |
||||
"src/core/channel/client_setup.c", |
||||
"src/core/channel/connected_channel.c", |
||||
"src/core/channel/http_client_filter.c", |
||||
"src/core/channel/http_filter.c", |
||||
"src/core/channel/http_server_filter.c", |
||||
"src/core/channel/metadata_buffer.c", |
||||
"src/core/channel/noop_filter.c", |
||||
"src/core/compression/algorithm.c", |
||||
"src/core/compression/message_compress.c", |
||||
"src/core/debug/trace.c", |
||||
"src/core/iomgr/alarm.c", |
||||
"src/core/iomgr/alarm_heap.c", |
||||
"src/core/iomgr/endpoint.c", |
||||
"src/core/iomgr/endpoint_pair_posix.c", |
||||
"src/core/iomgr/endpoint_pair_windows.c", |
||||
"src/core/iomgr/fd_posix.c", |
||||
"src/core/iomgr/iocp_windows.c", |
||||
"src/core/iomgr/iomgr.c", |
||||
"src/core/iomgr/iomgr_posix.c", |
||||
"src/core/iomgr/iomgr_windows.c", |
||||
"src/core/iomgr/pollset_kick.c", |
||||
"src/core/iomgr/pollset_multipoller_with_epoll.c", |
||||
"src/core/iomgr/pollset_multipoller_with_poll_posix.c", |
||||
"src/core/iomgr/pollset_posix.c", |
||||
"src/core/iomgr/pollset_windows.c", |
||||
"src/core/iomgr/resolve_address_posix.c", |
||||
"src/core/iomgr/resolve_address_windows.c", |
||||
"src/core/iomgr/sockaddr_utils.c", |
||||
"src/core/iomgr/socket_utils_common_posix.c", |
||||
"src/core/iomgr/socket_utils_linux.c", |
||||
"src/core/iomgr/socket_utils_posix.c", |
||||
"src/core/iomgr/socket_windows.c", |
||||
"src/core/iomgr/tcp_client_posix.c", |
||||
"src/core/iomgr/tcp_client_windows.c", |
||||
"src/core/iomgr/tcp_posix.c", |
||||
"src/core/iomgr/tcp_server_posix.c", |
||||
"src/core/iomgr/tcp_server_windows.c", |
||||
"src/core/iomgr/tcp_windows.c", |
||||
"src/core/iomgr/time_averaged_stats.c", |
||||
"src/core/iomgr/wakeup_fd_eventfd.c", |
||||
"src/core/iomgr/wakeup_fd_nospecial.c", |
||||
"src/core/iomgr/wakeup_fd_pipe.c", |
||||
"src/core/iomgr/wakeup_fd_posix.c", |
||||
"src/core/json/json.c", |
||||
"src/core/json/json_reader.c", |
||||
"src/core/json/json_string.c", |
||||
"src/core/json/json_writer.c", |
||||
"src/core/statistics/census_init.c", |
||||
"src/core/statistics/census_log.c", |
||||
"src/core/statistics/census_rpc_stats.c", |
||||
"src/core/statistics/census_tracing.c", |
||||
"src/core/statistics/hash_table.c", |
||||
"src/core/statistics/window_stats.c", |
||||
"src/core/surface/byte_buffer.c", |
||||
"src/core/surface/byte_buffer_queue.c", |
||||
"src/core/surface/byte_buffer_reader.c", |
||||
"src/core/surface/call.c", |
||||
"src/core/surface/call_details.c", |
||||
"src/core/surface/call_log_batch.c", |
||||
"src/core/surface/channel.c", |
||||
"src/core/surface/channel_create.c", |
||||
"src/core/surface/client.c", |
||||
"src/core/surface/completion_queue.c", |
||||
"src/core/surface/event_string.c", |
||||
"src/core/surface/init.c", |
||||
"src/core/surface/lame_client.c", |
||||
"src/core/surface/metadata_array.c", |
||||
"src/core/surface/server.c", |
||||
"src/core/surface/server_chttp2.c", |
||||
"src/core/surface/server_create.c", |
||||
"src/core/surface/surface_trace.c", |
||||
"src/core/transport/chttp2/alpn.c", |
||||
"src/core/transport/chttp2/bin_encoder.c", |
||||
"src/core/transport/chttp2/frame_data.c", |
||||
"src/core/transport/chttp2/frame_goaway.c", |
||||
"src/core/transport/chttp2/frame_ping.c", |
||||
"src/core/transport/chttp2/frame_rst_stream.c", |
||||
"src/core/transport/chttp2/frame_settings.c", |
||||
"src/core/transport/chttp2/frame_window_update.c", |
||||
"src/core/transport/chttp2/hpack_parser.c", |
||||
"src/core/transport/chttp2/hpack_table.c", |
||||
"src/core/transport/chttp2/huffsyms.c", |
||||
"src/core/transport/chttp2/status_conversion.c", |
||||
"src/core/transport/chttp2/stream_encoder.c", |
||||
"src/core/transport/chttp2/stream_map.c", |
||||
"src/core/transport/chttp2/timeout_encoding.c", |
||||
"src/core/transport/chttp2/varint.c", |
||||
"src/core/transport/chttp2_transport.c", |
||||
"src/core/transport/metadata.c", |
||||
"src/core/transport/stream_op.c", |
||||
"src/core/transport/transport.c", |
||||
], |
||||
hdrs = [ |
||||
"include/grpc/byte_buffer.h", |
||||
"include/grpc/byte_buffer_reader.h", |
||||
"include/grpc/grpc.h", |
||||
"include/grpc/grpc_http.h", |
||||
"include/grpc/status.h", |
||||
], |
||||
includes = [ |
||||
"include", |
||||
".", |
||||
], |
||||
deps = [ |
||||
":gpr", |
||||
], |
||||
) |
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,685 @@ |
||||
Interoperability Test Case Descriptions |
||||
======================================= |
||||
|
||||
Client and server use |
||||
[test.proto](https://github.com/grpc/grpc/blob/master/test/cpp/interop/test.proto) |
||||
and the [gRPC over HTTP/2 v2 |
||||
protocol](https://github.com/grpc/grpc-common/blob/master/PROTOCOL-HTTP2.md). |
||||
|
||||
Client |
||||
------ |
||||
|
||||
Clients implement test cases that test certain functionally. Each client is |
||||
provided the test case it is expected to run as a command-line parameter. Names |
||||
should be lowercase and without spaces. |
||||
|
||||
Clients should accept these arguments: |
||||
* --server_host=HOSTNAME |
||||
* The server host to connect to. For example, "localhost" or "127.0.0.1" |
||||
* --server_host_override=HOSTNAME |
||||
* The server host to claim to be connecting to, for use in TLS and HTTP/2 |
||||
:authority header. If unspecified, the value of --server_host will be |
||||
used |
||||
* --server_port=PORT |
||||
* The server port to connect to. For example, "8080" |
||||
* --test_case=TESTCASE |
||||
* The name of the test case to execute. For example, "empty_unary" |
||||
* --use_tls=BOOLEAN |
||||
* Whether to use a plaintext or encrypted connection |
||||
* --use_test_ca=BOOLEAN |
||||
* Whether to replace platform root CAs with |
||||
[ca.pem](https://github.com/grpc/grpc/blob/master/src/core/tsi/test_creds/ca.pem) |
||||
as the CA root |
||||
|
||||
Clients must support TLS with ALPN. Clients must not disable certificate |
||||
checking. |
||||
|
||||
### empty_unary |
||||
|
||||
This test verifies that implementations support zero-size messages. Ideally, |
||||
client implementations would verify that the request and response were zero |
||||
bytes serialized, but this is generally prohibitive to perform, so is not |
||||
required. |
||||
|
||||
Server features: |
||||
* [EmptyCall][] |
||||
|
||||
Procedure: |
||||
1. Client calls EmptyCall with the default Empty message |
||||
|
||||
Asserts: |
||||
* call was successful |
||||
* response is non-null |
||||
|
||||
*It may be possible to use UnaryCall instead of EmptyCall, but it is harder to |
||||
ensure that the proto serialized to zero bytes.* |
||||
|
||||
### large_unary |
||||
|
||||
This test verifies unary calls succeed in sending messages, and touches on flow |
||||
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 |
||||
} |
||||
} |
||||
``` |
||||
|
||||
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 |
||||
|
||||
### client_streaming |
||||
|
||||
This test verifies that client-only streaming succeeds. |
||||
|
||||
Server features: |
||||
* [StreamingInputCall][] |
||||
* [Compressable Payload][] |
||||
|
||||
Procedure: |
||||
1. Client calls StreamingInputCall |
||||
2. Client sends: |
||||
|
||||
``` |
||||
{ |
||||
payload:{ |
||||
body: 27182 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
3. Client then sends: |
||||
|
||||
``` |
||||
{ |
||||
payload:{ |
||||
body: 8 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
4. Client then sends: |
||||
|
||||
``` |
||||
{ |
||||
payload:{ |
||||
body: 1828 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
5. Client then sends: |
||||
|
||||
``` |
||||
{ |
||||
payload:{ |
||||
body: 45904 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
6. Client halfCloses |
||||
|
||||
Asserts: |
||||
* call was successful |
||||
* response aggregated_payload_size is 74922 |
||||
|
||||
### server_streaming |
||||
|
||||
This test verifies that server-only streaming succeeds. |
||||
|
||||
Server features: |
||||
* [StreamingOutputCall][] |
||||
* [Compressable Payload][] |
||||
|
||||
Procedure: |
||||
1. Client calls StreamingOutputCall with: |
||||
|
||||
``` |
||||
{ |
||||
response_type:COMPRESSABLE |
||||
response_parameters:{ |
||||
size: 31415 |
||||
} |
||||
response_parameters:{ |
||||
size: 9 |
||||
} |
||||
response_parameters:{ |
||||
size: 2653 |
||||
} |
||||
response_parameters:{ |
||||
size: 58979 |
||||
} |
||||
} |
||||
``` |
||||
|
||||
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 |
||||
|
||||
### 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 |
||||
} |
||||
payload:{ |
||||
body: 27182 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
2. After getting a reply, it sends: |
||||
|
||||
``` |
||||
{ |
||||
response_type: COMPRESSABLE |
||||
response_parameters:{ |
||||
size: 9 |
||||
} |
||||
payload:{ |
||||
body: 8 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
3. After getting a reply, it sends: |
||||
|
||||
``` |
||||
{ |
||||
response_type: COMPRESSABLE |
||||
response_parameters:{ |
||||
size: 2653 |
||||
} |
||||
payload:{ |
||||
body: 1828 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
4. After getting a reply, it sends: |
||||
|
||||
``` |
||||
{ |
||||
response_type: COMPRESSABLE |
||||
response_parameters:{ |
||||
size: 58979 |
||||
} |
||||
payload:{ |
||||
body: 45904 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
|
||||
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 |
||||
|
||||
### empty_stream |
||||
|
||||
This test verifies that streams support having zero-messages in both |
||||
directions. |
||||
|
||||
Server features: |
||||
* [FullDuplexCall][] |
||||
|
||||
Procedure: |
||||
1. Client calls FullDuplexCall and then half-closes |
||||
|
||||
Asserts: |
||||
* call was successful |
||||
* exactly zero responses |
||||
|
||||
### compute_engine_creds |
||||
|
||||
Status: Not yet implementable |
||||
|
||||
This test is only for cloud-to-prod path. |
||||
|
||||
This test verifies unary calls succeed in sending messages while using Service |
||||
Credentials from GCE metadata server. The client instance needs to be created |
||||
with desired oauth scope. |
||||
|
||||
Server features: |
||||
* [UnaryCall][] |
||||
* [Compressable Payload][] |
||||
* SimpeResponse.username |
||||
* SimpleResponse.oauth_scope |
||||
|
||||
Procedure: |
||||
1. Client sets flags default_service_account with GCE service account name and |
||||
oauth_scope with the oauth scope to use. |
||||
2. Client configures channel to use GCECredentials |
||||
3. Client calls UnaryCall on the channel with: |
||||
|
||||
``` |
||||
{ |
||||
response_type: COMPRESSABLE |
||||
response_size: 314159 |
||||
payload:{ |
||||
body: 271828 bytes of zeros |
||||
} |
||||
fill_username: true |
||||
fill_oauth_scope: true |
||||
} |
||||
``` |
||||
|
||||
Asserts: |
||||
* call was successful |
||||
* received SimpleResponse.username equals FLAGS_default_service_account |
||||
* received SimpleResponse.oauth_scope is in FLAGS_oauth_scope |
||||
* 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 |
||||
|
||||
### service_account_creds |
||||
|
||||
Status: Not yet implementable |
||||
|
||||
This test is only for cloud-to-prod path. |
||||
|
||||
This test verifies unary calls succeed in sending messages while using JWT |
||||
signing keys (redeemed for OAuth2 access tokens by the auth implementation) |
||||
|
||||
Server features: |
||||
* [UnaryCall][] |
||||
* [Compressable Payload][] |
||||
* SimpleResponse.username |
||||
* SimpleResponse.oauth_scope |
||||
|
||||
Procedure: |
||||
1. Client sets flags service_account_key_file with the path to json key file, |
||||
oauth_scope to the oauth scope. |
||||
2. Client configures the channel to use ServiceAccountCredentials. |
||||
3. Client calls UnaryCall with: |
||||
|
||||
``` |
||||
{ |
||||
response_type: COMPRESSABLE |
||||
response_size: 314159 |
||||
payload:{ |
||||
body: 271828 bytes of zeros |
||||
} |
||||
fill_username: true |
||||
fill_oauth_scope: true |
||||
} |
||||
``` |
||||
|
||||
Asserts: |
||||
* call was successful |
||||
* received SimpleResponse.username is in the json key file read from |
||||
FLAGS_service_account_key_file |
||||
* received SimpleResponse.oauth_scope is in FLAGS_oauth_scope |
||||
* 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 |
||||
|
||||
### jwt_token_creds |
||||
|
||||
Status: Not yet implementable |
||||
|
||||
This test is only for cloud-to-prod path. |
||||
|
||||
This test verifies unary calls succeed in sending messages while using JWT |
||||
token (created by the project's key file) |
||||
|
||||
Server features: |
||||
* [UnaryCall][] |
||||
* [Compressable Payload][] |
||||
* SimpleResponse.username |
||||
* SimpleResponse.oauth_scope |
||||
|
||||
Procedure: |
||||
1. Client sets flags service_account_key_file with the path to json key file |
||||
2. Client configures the channel to use JWTTokenCredentials. |
||||
3. Client calls UnaryCall with: |
||||
|
||||
``` |
||||
{ |
||||
response_type: COMPRESSABLE |
||||
response_size: 314159 |
||||
payload:{ |
||||
body: 271828 bytes of zeros |
||||
} |
||||
fill_username: true |
||||
} |
||||
``` |
||||
|
||||
Asserts: |
||||
* call was successful |
||||
* received SimpleResponse.username is in the json key file read from |
||||
FLAGS_service_account_key_file |
||||
* 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 |
||||
|
||||
### Metadata (TODO: fix name) |
||||
|
||||
Status: Not yet implementable |
||||
|
||||
This test verifies that custom metadata in either binary or ascii format can be |
||||
sent in header and trailer. |
||||
|
||||
Server features: |
||||
* [UnaryCall][] |
||||
* [Compressable Payload][] |
||||
* Ability to receive custom metadata from client in header and send custom data |
||||
back to client in both header and trailer. (TODO: this is not defined) |
||||
|
||||
Procedure: |
||||
1. While sending custom metadata (ascii + binary) in the header, client calls UnaryCall with: |
||||
|
||||
``` |
||||
{ |
||||
response_type: COMPRESSABLE |
||||
response_size: 314159 |
||||
payload:{ |
||||
body: 271828 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
|
||||
Asserts: |
||||
* call was successful |
||||
* custom metadata is echoed back in the response header. |
||||
* custom metadata is echoed back in the response trailer. |
||||
|
||||
### status_code_and_message |
||||
|
||||
Status: Not yet implementable |
||||
|
||||
This test verifies unary calls succeed in sending messages, and propagates back |
||||
status code and message sent along with the messages. |
||||
|
||||
Server features: |
||||
* [UnaryCall][] |
||||
|
||||
Procedure: |
||||
1. Client calls UnaryCall with: |
||||
|
||||
``` |
||||
{ |
||||
response_status:{ |
||||
code: 2 |
||||
message: "test status message" |
||||
} |
||||
} |
||||
``` |
||||
|
||||
Asserts: |
||||
* received status code is the same with sent code |
||||
* received status message is the same with sent message |
||||
|
||||
### unimplemented_method |
||||
|
||||
Status: Not yet implementable |
||||
|
||||
This test verifies calling unimplemented RPC method returns unimplemented |
||||
status. |
||||
|
||||
Procedure: |
||||
* Client calls UnimplementedCall with: |
||||
|
||||
``` |
||||
{ |
||||
response_type: COMPRESSABLE |
||||
response_size: 314159 |
||||
payload:{ |
||||
body: 271828 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
|
||||
Asserts: |
||||
* received status code is 12 (UNIMPLEMENTED) |
||||
* received status message is empty or null/unset |
||||
|
||||
### cancel_after_begin |
||||
|
||||
This test verifies that a request can be cancelled after metadata has been sent |
||||
but before payloads are sent. |
||||
|
||||
Server features: |
||||
* [StreamingInputCall][] |
||||
|
||||
Procedure: |
||||
1. Client starts StreamingInputCall |
||||
2. Client immediately cancels request |
||||
|
||||
Asserts: |
||||
* Call completed with status CANCELLED |
||||
|
||||
### cancel_after_first_response |
||||
|
||||
This test verifies that a request can be cancelled after receiving a message |
||||
from the server. |
||||
|
||||
Server features: |
||||
* [FullDuplexCall][] |
||||
* [Compressable Payload][] |
||||
|
||||
Procedure: |
||||
1. Client starts FullDuplexCall with |
||||
|
||||
``` |
||||
{ |
||||
response_type: COMPRESSABLE |
||||
response_parameters:{ |
||||
size: 31415 |
||||
} |
||||
payload:{ |
||||
body: 27182 bytes of zeros |
||||
} |
||||
} |
||||
``` |
||||
2. After receiving a response, client cancels request |
||||
|
||||
Asserts: |
||||
* Call completed with status CANCELLED |
||||
|
||||
### concurrent_large_unary |
||||
|
||||
Status: TODO |
||||
|
||||
Client performs 1000 large_unary tests in parallel on the same channel. |
||||
|
||||
### Flow control. Pushback at client for large messages (TODO: fix name) |
||||
|
||||
Status: TODO |
||||
|
||||
This test verifies that a client sending faster than a server can drain sees |
||||
pushback (i.e., attempts to send succeed only after appropriate delays). |
||||
|
||||
### TODO Tests |
||||
|
||||
High priority: |
||||
|
||||
Propagation of status code and message (yangg) |
||||
|
||||
Cancel after sent headers (ctiller - done) |
||||
|
||||
Cancel after received first message (ctiller - done) |
||||
|
||||
Timeout after expire (zhaoq) |
||||
|
||||
Zero-message streams (ejona) |
||||
|
||||
Multiple thousand simultaneous calls on same Channel (ctiller - done) |
||||
|
||||
OAuth2 tokens + Service Credentials from GCE metadata server (GCE->prod only) |
||||
(abhishek) |
||||
|
||||
OAuth2 tokens + JWT signing key (GCE->prod only) (abhishek) |
||||
|
||||
Metadata: client headers, server headers + trailers, binary+ascii (chenw) |
||||
|
||||
Normal priority: |
||||
|
||||
Cancel before start (ctiller) |
||||
|
||||
Cancel after sent first message (ctiller) |
||||
|
||||
Cancel after received headers (ctiller) |
||||
|
||||
Timeout but completed before expire (zhaoq) |
||||
|
||||
Multiple thousand simultaneous calls timeout on same Channel (ctiller) |
||||
|
||||
Lower priority: |
||||
|
||||
Flow control. Pushback at client for large messages (abhishek) |
||||
|
||||
Flow control. Pushback at server for large messages (abhishek) |
||||
|
||||
Going over max concurrent streams doesn't fail (client controls itself) |
||||
(abhishek) |
||||
|
||||
RPC method not implemented (yangg) |
||||
|
||||
Multiple thousand simultaneous calls on different Channels (ctiller) |
||||
|
||||
Failed TLS hostname verification (ejona?) |
||||
|
||||
To priorize: |
||||
|
||||
Start streaming RPC but don't send any requests, server responds |
||||
|
||||
### Postponed Tests |
||||
|
||||
Resilience to buggy servers: These tests would verify that a client application |
||||
isn't affected negatively by the responses put on the wire by a buggy server |
||||
(e.g. the client library won't make the application crash). |
||||
|
||||
Reconnect after transport failure |
||||
|
||||
Reconnect backoff |
||||
|
||||
Fuzz testing |
||||
|
||||
|
||||
Server |
||||
------ |
||||
|
||||
Servers implement various named features for clients to test with. Server |
||||
features are orthogonal. If a server implements a feature, it is always |
||||
available for clients. Names are simple descriptions for developer |
||||
communication and tracking. |
||||
|
||||
Servers should accept these arguments: |
||||
|
||||
* --port=PORT |
||||
|
||||
* The port to listen on. For example, "8080" |
||||
|
||||
* --use_tls=BOOLEAN |
||||
|
||||
* Whether to use a plaintext or encrypted connection |
||||
|
||||
Servers must support TLS with ALPN. They should use |
||||
[server1.pem](https://github.com/grpc/grpc/blob/master/src/core/tsi/test_creds/server1.pem) |
||||
for their certificate. |
||||
|
||||
### EmptyCall |
||||
[EmptyCall]: #emptycall |
||||
|
||||
Server implements EmptyCall which immediately returns the empty message. |
||||
|
||||
### UnaryCall |
||||
[UnaryCall]: #unarycall |
||||
|
||||
Server implements UnaryCall which immediately returns a SimpleResponse with a |
||||
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. |
||||
|
||||
If the request sets fill_username, the server should return the client username |
||||
it sees in field SimpleResponse.username. If the request sets fill_oauth_scope, |
||||
the server should return the oauth scope of the rpc in the form of "xapi_zoo" |
||||
in field SimpleResponse.oauth_scope. |
||||
|
||||
### StreamingInputCall |
||||
[StreamingInputCall]: #streaminginputcall |
||||
|
||||
Server implements StreamingInputCall which upon half close immediately returns |
||||
a StreamingInputCallResponse where aggregated_payload_size is the sum of all |
||||
request payload bodies received. |
||||
|
||||
### StreamingOutputCall |
||||
[StreamingOutputCall]: #streamingoutputcall |
||||
|
||||
Server implements StreamingOutputCall by replying, in order, with one |
||||
StreamingOutputCallResponses for each ResponseParameters in |
||||
StreamingOutputCallRequest. Each StreamingOutputCallResponses should have a |
||||
payload body of size ResponseParameters.size bytes, as specified by its |
||||
respective ResponseParameters. After sending all responses, it closes with OK. |
||||
|
||||
### FullDuplexCall |
||||
[FullDuplexCall]: #fullduplexcall |
||||
|
||||
Server implements FullDuplexCall by replying, in order, with one |
||||
StreamingOutputCallResponses for each ResponseParameters in each |
||||
StreamingOutputCallRequest. Each StreamingOutputCallResponses should have a |
||||
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. |
||||
|
||||
### Observe ResponseParameters.interval_us |
||||
[Observe ResponseParameters.interval_us]: #observe-responseparametersinterval_us |
||||
|
||||
In StreamingOutputCall and FullDuplexCall, server delays sending a |
||||
StreamingOutputCallResponse by the ResponseParameters's interval_us for that |
||||
particular response, relative to the last response sent. That is, interval_us |
||||
acts like a sleep *before* sending the response and accumulates from one |
||||
response to the next. |
||||
|
||||
Interaction with flow control is unspecified. |
||||
|
||||
### Echo Auth Information |
||||
|
||||
Status: Pending |
||||
|
||||
If a SimpleRequest has fill_username=true and that request was successfully |
||||
authenticated, then the SimpleResponse should have username filled with the |
||||
canonical form of the authenticated source. The canonical form is dependent on |
||||
the authentication method, but is likely to be a base 10 integer identifier or |
||||
an email address. |
||||
|
||||
Discussion: |
||||
|
||||
Ideally, this would be communicated via metadata and not in the |
||||
request/response, but we want to use this test in code paths that don't yet |
||||
fully communicate metadata. |
@ -0,0 +1,45 @@ |
||||
/*
|
||||
* |
||||
* 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_IMPL_SYNC_H |
||||
#define GRPCXX_IMPL_SYNC_H |
||||
|
||||
#include <grpc++/config.h> |
||||
|
||||
#ifdef GRPC_CXX0X_NO_THREAD |
||||
#include <grpc++/impl/sync_no_cxx11.h> |
||||
#else |
||||
#include <grpc++/impl/sync_cxx11.h> |
||||
#endif |
||||
|
||||
#endif // GRPCXX_IMPL_SYNC_H
|
@ -0,0 +1,49 @@ |
||||
/*
|
||||
* |
||||
* 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_IMPL_SYNC_CXX11_H |
||||
#define GRPCXX_IMPL_SYNC_CXX11_H |
||||
|
||||
#include <condition_variable> |
||||
#include <mutex> |
||||
|
||||
namespace grpc { |
||||
|
||||
using std::condition_variable; |
||||
using std::mutex; |
||||
using std::lock_guard; |
||||
using std::unique_lock; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPCXX_IMPL_SYNC_CXX11_H
|
@ -0,0 +1,101 @@ |
||||
/*
|
||||
* |
||||
* 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_IMPL_SYNC_NO_CXX11_H |
||||
#define GRPCXX_IMPL_SYNC_NO_CXX11_H |
||||
|
||||
#include <grpc/support/sync.h> |
||||
|
||||
namespace grpc { |
||||
|
||||
template<class mutex> |
||||
class lock_guard; |
||||
class condition_variable; |
||||
|
||||
class mutex { |
||||
public: |
||||
mutex() { gpr_mu_init(&mu_); } |
||||
~mutex() { gpr_mu_destroy(&mu_); } |
||||
private: |
||||
::gpr_mu mu_; |
||||
template <class mutex> |
||||
friend class lock_guard; |
||||
friend class condition_variable; |
||||
}; |
||||
|
||||
template <class mutex> |
||||
class lock_guard { |
||||
public: |
||||
lock_guard(mutex &mu) : mu_(mu), locked(true) { gpr_mu_lock(&mu.mu_); } |
||||
~lock_guard() { unlock_internal(); } |
||||
protected: |
||||
void lock_internal() { |
||||
if (!locked) gpr_mu_lock(&mu_.mu_); |
||||
locked = true; |
||||
} |
||||
void unlock_internal() { |
||||
if (locked) gpr_mu_unlock(&mu_.mu_); |
||||
locked = false; |
||||
} |
||||
private: |
||||
mutex &mu_; |
||||
bool locked; |
||||
friend class condition_variable; |
||||
}; |
||||
|
||||
template <class mutex> |
||||
class unique_lock : public lock_guard<mutex> { |
||||
public: |
||||
unique_lock(mutex &mu) : lock_guard(mu) { } |
||||
void lock() { lock_internal(); } |
||||
void unlock() { unlock_internal(); } |
||||
}; |
||||
|
||||
class condition_variable { |
||||
public: |
||||
condition_variable() { gpr_cv_init(&cv_); } |
||||
~condition_variable() { gpr_cv_destroy(&cv_); } |
||||
void wait(lock_guard<mutex> &mu) { |
||||
mu.locked = false; |
||||
gpr_cv_wait(&cv_, &mu.mu_.mu_, gpr_inf_future); |
||||
mu.locked = true; |
||||
} |
||||
void notify_one() { gpr_cv_signal(&cv_); } |
||||
void notify_all() { gpr_cv_broadcast(&cv_); } |
||||
private: |
||||
gpr_cv cv_; |
||||
}; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPCXX_IMPL_SYNC_NO_CXX11_H
|
@ -0,0 +1,45 @@ |
||||
/*
|
||||
* |
||||
* 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_IMPL_THD_H |
||||
#define GRPCXX_IMPL_THD_H |
||||
|
||||
#include <grpc++/config.h> |
||||
|
||||
#ifdef GRPC_CXX0X_NO_THREAD |
||||
#include <grpc++/impl/thd_no_cxx11.h> |
||||
#else |
||||
#include <grpc++/impl/thd_cxx11.h> |
||||
#endif |
||||
|
||||
#endif // GRPCXX_IMPL_THD_H
|
@ -0,0 +1,45 @@ |
||||
/*
|
||||
* |
||||
* 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_IMPL_THD_CXX11_H |
||||
#define GRPCXX_IMPL_THD_CXX11_H |
||||
|
||||
#include <thread> |
||||
|
||||
namespace grpc { |
||||
|
||||
using std::thread; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPCXX_IMPL_THD_CXX11_H
|
@ -0,0 +1,89 @@ |
||||
/*
|
||||
* |
||||
* 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_IMPL_THD_NO_CXX11_H |
||||
#define GRPCXX_IMPL_THD_NO_CXX11_H |
||||
|
||||
#include <grpc/support/thd.h> |
||||
|
||||
namespace grpc { |
||||
|
||||
class thread { |
||||
public: |
||||
template<class T> thread(void (T::*fptr)(), T *obj) { |
||||
func_ = new thread_function<T>(fptr, obj); |
||||
joined_ = false; |
||||
start(); |
||||
} |
||||
~thread() { |
||||
if (!joined_) std::terminate(); |
||||
delete func_; |
||||
} |
||||
void join() { |
||||
gpr_thd_join(thd_); |
||||
joined_ = true; |
||||
} |
||||
private: |
||||
void start() { |
||||
gpr_thd_options options = gpr_thd_options_default(); |
||||
gpr_thd_options_set_joinable(&options); |
||||
gpr_thd_new(&thd_, thread_func, (void *) func_, &options); |
||||
} |
||||
static void thread_func(void *arg) { |
||||
thread_function_base *func = (thread_function_base *) arg; |
||||
func->call(); |
||||
} |
||||
class thread_function_base { |
||||
public: |
||||
virtual ~thread_function_base() { } |
||||
virtual void call() = 0; |
||||
}; |
||||
template<class T> |
||||
class thread_function : public thread_function_base { |
||||
public: |
||||
thread_function(void (T::*fptr)(), T *obj) |
||||
: fptr_(fptr) |
||||
, obj_(obj) { } |
||||
virtual void call() { (obj_->*fptr_)(); } |
||||
private: |
||||
void (T::*fptr_)(); |
||||
T *obj_; |
||||
}; |
||||
thread_function_base *func_; |
||||
gpr_thd_id thd_; |
||||
bool joined_; |
||||
}; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPCXX_IMPL_THD_NO_CXX11_H
|
@ -0,0 +1,77 @@ |
||||
/*
|
||||
* |
||||
* 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 GRPC_SUPPORT_TLS_H |
||||
#define GRPC_SUPPORT_TLS_H |
||||
|
||||
#include "port_platform.h" |
||||
|
||||
/* Thread local storage.
|
||||
|
||||
A minimal wrapper that should be implementable across many compilers, |
||||
and implementable efficiently across most modern compilers. |
||||
|
||||
Thread locals have type gpr_intptr. |
||||
|
||||
Declaring a thread local variable 'foo': |
||||
GPR_TLS_DECL(foo, initial_value); |
||||
Thread locals always have static scope. |
||||
|
||||
Initializing a thread local (must be done at library initialization
|
||||
time): |
||||
gpr_tls_init(&foo); |
||||
|
||||
Destroying a thread local: |
||||
gpr_tls_destroy(&foo); |
||||
|
||||
Setting a thread local: |
||||
gpr_tls_set(&foo, new_value); |
||||
|
||||
Accessing a thread local: |
||||
current_value = gpr_tls_get(&foo, value);
|
||||
|
||||
ALL functions here may be implemented as macros. */ |
||||
|
||||
#ifdef GPR_GCC_TLS |
||||
#include "tls_gcc.h" |
||||
#endif |
||||
|
||||
#ifdef GPR_MSVC_TLS |
||||
#include "tls_msvc.h" |
||||
#endif |
||||
|
||||
#ifdef GPR_PTHREAD_TLS |
||||
#include "tls_pthread.h" |
||||
#endif |
||||
|
||||
#endif |
@ -0,0 +1,52 @@ |
||||
/*
|
||||
* |
||||
* 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 GRPC_SUPPORT_TLS_GCC_H |
||||
#define GRPC_SUPPORT_TLS_GCC_H |
||||
|
||||
/* Thread local storage based on gcc compiler primitives.
|
||||
#include tls.h to use this - and see that file for documentation */ |
||||
|
||||
struct gpr_gcc_thread_local { |
||||
gpr_intptr value; |
||||
}; |
||||
|
||||
#define GPR_TLS_DECL(name) \ |
||||
static __thread struct gpr_gcc_thread_local name = {0} |
||||
|
||||
#define gpr_tls_init(tls) do {} while (0) |
||||
#define gpr_tls_destroy(tls) do {} while (0) |
||||
#define gpr_tls_set(tls, new_value) (((tls)->value) = (new_value)) |
||||
#define gpr_tls_get(tls) ((tls)->value) |
||||
|
||||
#endif |
@ -0,0 +1,52 @@ |
||||
/*
|
||||
* |
||||
* 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 GRPC_SUPPORT_TLS_GCC_H |
||||
#define GRPC_SUPPORT_TLS_GCC_H |
||||
|
||||
/* Thread local storage based on ms visual c compiler primitives.
|
||||
#include tls.h to use this - and see that file for documentation */ |
||||
|
||||
struct gpr_msvc_thread_local { |
||||
gpr_intptr value; |
||||
}; |
||||
|
||||
#define GPR_TLS_DECL(name) \ |
||||
static __thread struct gpr_msvc_thread_local name = {0} |
||||
|
||||
#define gpr_tls_init(tls) do {} while (0) |
||||
#define gpr_tls_destroy(tls) do {} while (0) |
||||
#define gpr_tls_set(tls, new_value) (((tls)->value) = (new_value)) |
||||
#define gpr_tls_get(tls) ((tls)->value) |
||||
|
||||
#endif |
@ -0,0 +1,53 @@ |
||||
/*
|
||||
* |
||||
* 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 GRPC_SUPPORT_TLS_PTHREAD_H |
||||
#define GRPC_SUPPORT_TLS_PTHREAD_H |
||||
|
||||
/* Thread local storage based on pthread library calls.
|
||||
#include tls.h to use this - and see that file for documentation */ |
||||
|
||||
struct gpr_pthread_thread_local { |
||||
pthread_key_t key; |
||||
}; |
||||
|
||||
#define GPR_TLS_DECL(name) \ |
||||
static struct gpr_pthread_thread_local name = {0} |
||||
|
||||
#define gpr_tls_init(tls) GPR_ASSERT(0 == pthread_key_create(&(tls)->key, NULL)) |
||||
#define gpr_tls_destroy(tls) pthread_key_delete((tls)->key) |
||||
#define gpr_tls_set(tls, new_value) \ |
||||
GPR_ASSERT(pthread_setspecific((tls)->key, (void*)(new_value)) == 0) |
||||
#define gpr_tls_get(tls) ((gpr_intptr)pthread_getspecific((tls)->key)) |
||||
|
||||
#endif |
@ -0,0 +1,236 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#include <map> |
||||
|
||||
#include "src/compiler/objective_c_generator.h" |
||||
#include "src/compiler/objective_c_generator_helpers.h" |
||||
|
||||
#include "src/compiler/config.h" |
||||
|
||||
#include <sstream> |
||||
|
||||
namespace grpc_objective_c_generator { |
||||
namespace { |
||||
|
||||
void PrintSimpleBlockSignature(grpc::protobuf::io::Printer *printer, |
||||
const grpc::protobuf::MethodDescriptor *method, |
||||
std::map<grpc::string, grpc::string> *vars) { |
||||
(*vars)["method_name"] = method->name(); |
||||
(*vars)["request_type"] = PrefixedName(method->input_type()->name()); |
||||
(*vars)["response_type"] = PrefixedName(method->output_type()->name()); |
||||
|
||||
if (method->server_streaming()) { |
||||
printer->Print("// When the response stream finishes, the handler is " |
||||
"called with nil for both arguments.\n\n"); |
||||
} else { |
||||
printer->Print("// The handler is only called once.\n\n"); |
||||
} |
||||
printer->Print(*vars, "- (id<GRXLiveSource>)$method_name$WithRequest:" |
||||
"($request_type$)request completionHandler:(void(^)" |
||||
"($response_type$ *, NSError *))handler"); |
||||
} |
||||
|
||||
void PrintSimpleDelegateSignature(grpc::protobuf::io::Printer *printer, |
||||
const grpc::protobuf::MethodDescriptor *method, |
||||
std::map<grpc::string, grpc::string> *vars) { |
||||
(*vars)["method_name"] = method->name(); |
||||
(*vars)["request_type"] = PrefixedName(method->input_type()->name()); |
||||
|
||||
printer->Print(*vars, "- (id<GRXLiveSource>)$method_name$WithRequest:" |
||||
"($request_type$)request delegate:(id<GRXSink>)delegate"); |
||||
} |
||||
|
||||
void PrintAdvancedSignature(grpc::protobuf::io::Printer *printer, |
||||
const grpc::protobuf::MethodDescriptor *method, |
||||
std::map<grpc::string, grpc::string> *vars) { |
||||
(*vars)["method_name"] = method->name(); |
||||
printer->Print(*vars, "- (GRXSource *)$method_name$WithRequest:" |
||||
"(id<GRXSource>)request"); |
||||
} |
||||
|
||||
void PrintSourceMethodSimpleBlock(grpc::protobuf::io::Printer *printer, |
||||
const grpc::protobuf::MethodDescriptor *method, |
||||
std::map<grpc::string, grpc::string> *vars) { |
||||
PrintSimpleBlockSignature(printer, method, vars); |
||||
|
||||
(*vars)["method_name"] = method->name(); |
||||
printer->Print(" {\n"); |
||||
printer->Indent(); |
||||
printer->Print(*vars, "return [[self $method_name$WithRequest:request] " |
||||
"connectHandler:^(id value, NSError *error) {\n"); |
||||
printer->Indent(); |
||||
printer->Print("handler(value, error);\n"); |
||||
printer->Outdent(); |
||||
printer->Print("}];\n"); |
||||
printer->Outdent(); |
||||
printer->Print("}\n"); |
||||
} |
||||
|
||||
void PrintSourceMethodSimpleDelegate(grpc::protobuf::io::Printer *printer, |
||||
const grpc::protobuf::MethodDescriptor *method, |
||||
std::map<grpc::string, grpc::string> *vars) { |
||||
PrintSimpleDelegateSignature(printer, method, vars); |
||||
|
||||
(*vars)["method_name"] = method->name(); |
||||
printer->Print(" {\n"); |
||||
printer->Indent(); |
||||
printer->Print(*vars, "return [[self $method_name$WithRequest:request]" |
||||
"connectToSink:delegate];\n"); |
||||
printer->Outdent(); |
||||
printer->Print("}\n"); |
||||
} |
||||
|
||||
void PrintSourceMethodAdvanced(grpc::protobuf::io::Printer *printer, |
||||
const grpc::protobuf::MethodDescriptor *method, |
||||
std::map<grpc::string, grpc::string> *vars) { |
||||
PrintAdvancedSignature(printer, method, vars); |
||||
|
||||
(*vars)["method_name"] = method->name(); |
||||
printer->Print(" {\n"); |
||||
printer->Indent(); |
||||
printer->Print(*vars, "return [self $method_name$WithRequest:request " |
||||
"client:[self newClient]];\n"); |
||||
printer->Outdent(); |
||||
printer->Print("}\n"); |
||||
} |
||||
|
||||
void PrintSourceMethodHandler(grpc::protobuf::io::Printer *printer, |
||||
const grpc::protobuf::MethodDescriptor *method, |
||||
std::map<grpc::string, grpc::string> *vars) { |
||||
(*vars)["method_name"] = method->name(); |
||||
(*vars)["response_type"] = PrefixedName(method->output_type()->name()); |
||||
(*vars)["caps_name"] = grpc_generator::CapitalizeFirstLetter(method->name()); |
||||
|
||||
printer->Print(*vars, "- (GRXSource *)$method_name$WithRequest:" |
||||
"(id<GRXSource>)request client:(PBgRPCClient *)client {\n"); |
||||
printer->Indent(); |
||||
printer->Print(*vars, |
||||
"return [self responseWithMethod:$@\"$caps_name\"\n"); |
||||
printer->Print(*vars, |
||||
" class:[$response_type$ class]\n"); |
||||
printer->Print(" request:request\n"); |
||||
printer->Print(" client:client];\n"); |
||||
printer->Outdent(); |
||||
printer->Print("}\n"); |
||||
} |
||||
|
||||
} |
||||
|
||||
grpc::string GetHeader(const grpc::protobuf::ServiceDescriptor *service, |
||||
const grpc::string message_header) { |
||||
grpc::string output; |
||||
grpc::protobuf::io::StringOutputStream output_stream(&output); |
||||
grpc::protobuf::io::Printer printer(&output_stream, '$'); |
||||
std::map<grpc::string, grpc::string> vars; |
||||
printer.Print("#import \"PBgRPCClient.h\"\n"); |
||||
printer.Print("#import \"PBStub.h\"\n"); |
||||
vars["message_header"] = message_header; |
||||
printer.Print(vars, "#import \"$message_header$\"\n\n"); |
||||
printer.Print("@protocol GRXSource\n"); |
||||
printer.Print("@class GRXSource\n\n"); |
||||
vars["service_name"] = service->name(); |
||||
printer.Print("@protocol $service_name$Stub <NSObject>\n\n"); |
||||
printer.Print("#pragma mark Simple block handlers\n\n"); |
||||
for (int i = 0; i < service->method_count(); i++) { |
||||
PrintSimpleBlockSignature(&printer, service->method(i), &vars); |
||||
printer.Print(";\n"); |
||||
} |
||||
printer.Print("\n"); |
||||
printer.Print("#pragma mark Simple delegate handlers.\n\n"); |
||||
printer.Print("# TODO(jcanizales): Use high-level snippets to remove this duplication."); |
||||
for (int i = 0; i < service->method_count(); i++) { |
||||
PrintSimpleDelegateSignature(&printer, service->method(i), &vars); |
||||
printer.Print(";\n"); |
||||
} |
||||
printer.Print("\n"); |
||||
printer.Print("#pragma mark Advanced handlers.\n\n"); |
||||
for (int i = 0; i < service->method_count(); i++) { |
||||
PrintAdvancedSignature(&printer, service->method(i), &vars); |
||||
printer.Print(";\n"); |
||||
} |
||||
printer.Print("\n"); |
||||
printer.Print("@end\n\n"); |
||||
printer.Print("// Basic stub that only does marshalling and parsing\n"); |
||||
printer.Print(vars, "@interface $service_name$Stub :" |
||||
" PBStub<$service_name$Stub>\n"); |
||||
printer.Print("- (instancetype)initWithHost:(NSString *)host;\n"); |
||||
printer.Print("@end\n"); |
||||
return output; |
||||
} |
||||
|
||||
grpc::string GetSource(const grpc::protobuf::ServiceDescriptor *service) { |
||||
grpc::string output; |
||||
grpc::protobuf::io::StringOutputStream output_stream(&output); |
||||
grpc::protobuf::io::Printer printer(&output_stream, '$'); |
||||
std::map<grpc::string, grpc::string> vars; |
||||
vars["service_name"] = service->name(); |
||||
printer.Print(vars, "#import \"$service_name$Stub.pb.h\"\n"); |
||||
printer.Print("#import \"PBGeneratedMessage+GRXSource.h\"\n\n"); |
||||
vars["full_name"] = service->full_name(); |
||||
printer.Print(vars, |
||||
"static NSString *const kInterface = @\"$full_name$\";\n"); |
||||
printer.Print("@implementation $service_name$Stub\n\n"); |
||||
printer.Print("- (instancetype)initWithHost:(NSString *)host {\n"); |
||||
printer.Indent(); |
||||
printer.Print("if ((self = [super initWithHost:host " |
||||
"interface:kInterface])) {\n"); |
||||
printer.Print("}\n"); |
||||
printer.Print("return self;\n"); |
||||
printer.Outdent(); |
||||
printer.Print("}\n\n"); |
||||
printer.Print("#pragma mark Simple block handlers.\n"); |
||||
for (int i = 0; i < service->method_count(); i++) { |
||||
PrintSourceMethodSimpleBlock(&printer, service->method(i), &vars); |
||||
} |
||||
printer.Print("\n"); |
||||
printer.Print("#pragma mark Simple delegate handlers.\n"); |
||||
for (int i = 0; i < service->method_count(); i++) { |
||||
PrintSourceMethodSimpleDelegate(&printer, service->method(i), &vars); |
||||
} |
||||
printer.Print("\n"); |
||||
printer.Print("#pragma mark Advanced handlers.\n"); |
||||
for (int i = 0; i < service->method_count(); i++) { |
||||
PrintSourceMethodAdvanced(&printer, service->method(i), &vars); |
||||
} |
||||
printer.Print("\n"); |
||||
printer.Print("#pragma mark Handlers for subclasses " |
||||
"(stub wrappers) to override.\n"); |
||||
for (int i = 0; i < service->method_count(); i++) { |
||||
PrintSourceMethodHandler(&printer, service->method(i), &vars); |
||||
} |
||||
printer.Print("@end\n"); |
||||
return output; |
||||
} |
||||
|
||||
} // namespace grpc_objective_c_generator
|
@ -0,0 +1,58 @@ |
||||
/*
|
||||
* |
||||
* 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 GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H |
||||
#define GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H |
||||
|
||||
#include <map> |
||||
#include "src/compiler/config.h" |
||||
#include "src/compiler/generator_helpers.h" |
||||
|
||||
namespace grpc_objective_c_generator { |
||||
|
||||
const grpc::string prefix = "PBG"; |
||||
|
||||
inline grpc::string MessageHeaderName(const grpc::protobuf::FileDescriptor *file) { |
||||
return grpc_generator::FileNameInUpperCamel(file) + ".pb.h"; |
||||
} |
||||
|
||||
inline grpc::string StubFileName(grpc::string service_name) { |
||||
return prefix + service_name + "Stub"; |
||||
} |
||||
|
||||
inline grpc::string PrefixedName(grpc::string name) { |
||||
return prefix + name; |
||||
} |
||||
|
||||
} |
||||
#endif // GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H
|
@ -0,0 +1,98 @@ |
||||
/*
|
||||
* |
||||
* 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. |
||||
* |
||||
*/ |
||||
|
||||
// Generates Objective C gRPC service interface out of Protobuf IDL.
|
||||
|
||||
#include <memory> |
||||
|
||||
#include "src/compiler/config.h" |
||||
#include "src/compiler/objective_c_generator.h" |
||||
#include "src/compiler/objective_c_generator_helpers.h" |
||||
|
||||
class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { |
||||
public: |
||||
ObjectiveCGrpcGenerator() {} |
||||
virtual ~ObjectiveCGrpcGenerator() {} |
||||
|
||||
virtual bool Generate(const grpc::protobuf::FileDescriptor *file, |
||||
const grpc::string ¶meter, |
||||
grpc::protobuf::compiler::GeneratorContext *context, |
||||
grpc::string *error) const { |
||||
|
||||
if (file->service_count() == 0) { |
||||
// No services. Do nothing.
|
||||
return true; |
||||
} |
||||
|
||||
for (int i = 0; i < file->service_count(); i++) { |
||||
const grpc::protobuf::ServiceDescriptor *service = file->service(i); |
||||
grpc::string file_name = grpc_objective_c_generator::StubFileName( |
||||
service->name()); |
||||
|
||||
// Generate .pb.h
|
||||
grpc::string header_code = grpc_objective_c_generator::GetHeader( |
||||
service, grpc_objective_c_generator::MessageHeaderName(file)); |
||||
std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> header_output( |
||||
context->Open(file_name + ".pb.h")); |
||||
grpc::protobuf::io::CodedOutputStream header_coded_out( |
||||
header_output.get()); |
||||
header_coded_out.WriteRaw(header_code.data(), header_code.size()); |
||||
|
||||
// Generate .pb.m
|
||||
grpc::string source_code = grpc_objective_c_generator::GetSource(service); |
||||
std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> source_output( |
||||
context->Open(file_name + ".pb.m")); |
||||
grpc::protobuf::io::CodedOutputStream source_coded_out( |
||||
source_output.get()); |
||||
source_coded_out.WriteRaw(source_code.data(), source_code.size()); |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
private: |
||||
// Insert the given code into the given file at the given insertion point.
|
||||
void Insert(grpc::protobuf::compiler::GeneratorContext *context, |
||||
const grpc::string &filename, const grpc::string &insertion_point, |
||||
const grpc::string &code) const { |
||||
std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> output( |
||||
context->OpenForInsert(filename, insertion_point)); |
||||
grpc::protobuf::io::CodedOutputStream coded_out(output.get()); |
||||
coded_out.WriteRaw(code.data(), code.size()); |
||||
} |
||||
}; |
||||
|
||||
int main(int argc, char *argv[]) { |
||||
ObjectiveCGrpcGenerator generator; |
||||
return grpc::protobuf::compiler::PluginMain(argc, argv, &generator); |
||||
} |
@ -0,0 +1,66 @@ |
||||
/*
|
||||
* |
||||
* 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. |
||||
* |
||||
*/ |
||||
|
||||
/* Posix implementation for gpr threads. */ |
||||
|
||||
#include <memory.h> |
||||
|
||||
#include <grpc/support/thd.h> |
||||
|
||||
enum { |
||||
GPR_THD_JOINABLE = 1 |
||||
}; |
||||
|
||||
gpr_thd_options gpr_thd_options_default(void) { |
||||
gpr_thd_options options; |
||||
memset(&options, 0, sizeof(options)); |
||||
return options; |
||||
} |
||||
|
||||
void gpr_thd_options_set_detached(gpr_thd_options *options) { |
||||
options->flags &= ~GPR_THD_JOINABLE; |
||||
} |
||||
|
||||
void gpr_thd_options_set_joinable(gpr_thd_options *options) { |
||||
options->flags |= GPR_THD_JOINABLE; |
||||
} |
||||
|
||||
int gpr_thd_options_is_detached(const gpr_thd_options *options) { |
||||
if (!options) return 1; |
||||
return (options->flags & GPR_THD_JOINABLE) == 0; |
||||
} |
||||
|
||||
int gpr_thd_options_is_joinable(const gpr_thd_options *options) { |
||||
if (!options) return 0; |
||||
return (options->flags & GPR_THD_JOINABLE) == GPR_THD_JOINABLE; |
||||
} |
@ -0,0 +1,61 @@ |
||||
/*
|
||||
* |
||||
* 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 GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H |
||||
#define GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H |
||||
|
||||
#include <grpc/grpc_security.h> |
||||
|
||||
#include <grpc++/config.h> |
||||
#include <grpc++/credentials.h> |
||||
|
||||
namespace grpc { |
||||
|
||||
class SecureCredentials GRPC_FINAL : public Credentials { |
||||
public: |
||||
explicit SecureCredentials(grpc_credentials* c_creds) : c_creds_(c_creds) {} |
||||
~SecureCredentials() GRPC_OVERRIDE { grpc_credentials_release(c_creds_); } |
||||
grpc_credentials* GetRawCreds() { return c_creds_; } |
||||
|
||||
std::shared_ptr<grpc::ChannelInterface> CreateChannel( |
||||
const string& target, const grpc::ChannelArguments& args) GRPC_OVERRIDE; |
||||
SecureCredentials* AsSecureCredentials() GRPC_OVERRIDE { return this; } |
||||
|
||||
private: |
||||
grpc_credentials* const c_creds_; |
||||
}; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H
|
||||
|
@ -0,0 +1,60 @@ |
||||
/*
|
||||
* |
||||
* 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 GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H |
||||
#define GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H |
||||
|
||||
#include <grpc/grpc_security.h> |
||||
|
||||
#include <grpc++/server_credentials.h> |
||||
|
||||
namespace grpc { |
||||
|
||||
class SecureServerCredentials GRPC_FINAL : public ServerCredentials { |
||||
public: |
||||
explicit SecureServerCredentials(grpc_server_credentials* creds) |
||||
: creds_(creds) {} |
||||
~SecureServerCredentials() GRPC_OVERRIDE { |
||||
grpc_server_credentials_release(creds_); |
||||
} |
||||
|
||||
int AddPortToServer(const grpc::string& addr, |
||||
grpc_server* server) GRPC_OVERRIDE; |
||||
|
||||
private: |
||||
grpc_server_credentials* const creds_; |
||||
}; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H
|
@ -0,0 +1,2 @@ |
||||
bin |
||||
obj |
@ -0,0 +1,52 @@ |
||||
<?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> |
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> |
||||
<ProductVersion>10.0.0</ProductVersion> |
||||
<SchemaVersion>2.0</SchemaVersion> |
||||
<ProjectGuid>{BF62FE08-373A-43D6-9D73-41CAA38B7011}</ProjectGuid> |
||||
<OutputType>Exe</OutputType> |
||||
<RootNamespace>Grpc.Examples.MathServer</RootNamespace> |
||||
<AssemblyName>Grpc.Examples.MathServer</AssemblyName> |
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>full</DebugType> |
||||
<Optimize>false</Optimize> |
||||
<OutputPath>bin\Debug</OutputPath> |
||||
<DefineConstants>DEBUG;</DefineConstants> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>4</WarningLevel> |
||||
<Externalconsole>true</Externalconsole> |
||||
<PlatformTarget>x86</PlatformTarget> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> |
||||
<DebugType>full</DebugType> |
||||
<Optimize>true</Optimize> |
||||
<OutputPath>bin\Release</OutputPath> |
||||
<ErrorReport>prompt</ErrorReport> |
||||
<WarningLevel>4</WarningLevel> |
||||
<Externalconsole>true</Externalconsole> |
||||
<PlatformTarget>x86</PlatformTarget> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
||||
<Compile Include="MathServer.cs" /> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\Grpc.Core\Grpc.Core.csproj"> |
||||
<Project>{CCC4440E-49F7-4790-B0AF-FEABB0837AE7}</Project> |
||||
<Name>Grpc.Core</Name> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\Grpc.Examples\Grpc.Examples.csproj"> |
||||
<Project>{7DC1433E-3225-42C7-B7EA-546D56E27A4B}</Project> |
||||
<Name>Grpc.Examples</Name> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
</Project> |
@ -0,0 +1,61 @@ |
||||
#region Copyright notice and license |
||||
// 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. |
||||
#endregion |
||||
|
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
using System.Threading; |
||||
using Grpc.Core; |
||||
|
||||
namespace math |
||||
{ |
||||
class MainClass |
||||
{ |
||||
public static void Main(string[] args) |
||||
{ |
||||
String host = "0.0.0.0"; |
||||
|
||||
GrpcEnvironment.Initialize(); |
||||
|
||||
Server server = new Server(); |
||||
server.AddServiceDefinition(MathGrpc.BindService(new MathServiceImpl())); |
||||
int port = server.AddListeningPort(host + ":0"); |
||||
server.Start(); |
||||
|
||||
Console.WriteLine("MathServer listening on port " + port); |
||||
|
||||
Console.WriteLine("Press any key to stop the server..."); |
||||
Console.ReadKey(); |
||||
|
||||
server.ShutdownAsync().Wait(); |
||||
GrpcEnvironment.Shutdown(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,12 @@ |
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
[assembly: AssemblyTitle("Grpc.Examples.MathServer")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("")] |
||||
[assembly: AssemblyCopyright("Google Inc. All rights reserved.")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
[assembly: AssemblyVersion("0.1.*")] |
@ -0,0 +1,3 @@ |
||||
MANIFEST |
||||
grpcio.egg-info/ |
||||
dist/ |
@ -0,0 +1 @@ |
||||
graft grpc |
@ -0,0 +1,27 @@ |
||||
gRPC Python |
||||
=========== |
||||
|
||||
Package for GRPC Python. |
||||
|
||||
Dependencies |
||||
------------ |
||||
|
||||
Ensure that you have installed GRPC core. |
||||
|
||||
On debian linux systems, install from our released deb package: |
||||
|
||||
:: |
||||
|
||||
$ wget https://github.com/grpc/grpc/releases/download/release-0_5_0/libgrpc_0.5.0_amd64.deb |
||||
$ wget https://github.com/grpc/grpc/releases/download/release-0_5_0/libgrpc-dev_0.5.0_amd64.deb |
||||
$ sudo dpkg -i libgrpc_0.5.0_amd64.deb libgrpc-dev_0.5.0_amd64.deb |
||||
|
||||
Otherwise, install from source: |
||||
|
||||
:: |
||||
|
||||
git clone https://github.com/grpc/grpc.git |
||||
cd grpc |
||||
./configure |
||||
make && make install |
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue