temporarily port #7833

pull/7466/head
Sree Kuchibhotla 8 years ago
parent 7974232f41
commit f6f153d02b
  1. 10
      include/grpc/grpc_posix.h
  2. 7
      src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c
  3. 2
      src/ruby/ext/grpc/rb_grpc_imports.generated.h

@ -57,11 +57,13 @@ GRPCAPI grpc_channel *grpc_insecure_channel_create_from_fd(
/** Add the connected communication channel based on file descriptor 'fd' to the
'server'. The 'fd' must be an open file descriptor corresponding to a
connected socket. The 'cq' is a completion queue that will be getting events
from that descriptor. */
connected socket. Events from the file descriptor may come on any of the
server completion queues (i.e completion queues registered via the
grpc_server_register_completion_queue API).
The 'reserved' pointer MUST be NULL */
GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
grpc_completion_queue *cq,
int fd);
void *reserved, int fd);
/** GRPC Core POSIX library may internally use signals to optimize some work.
The library uses (SIGRTMIN + 2) signal by default. Use this API to instruct

@ -50,8 +50,10 @@
#include "src/core/lib/surface/server.h"
void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
grpc_completion_queue *cq,
void *reserved,
int fd) {
GPR_ASSERT(reserved == NULL);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
char *name;
@ -74,7 +76,6 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
grpc_endpoint_add_to_pollset(&exec_ctx, server_endpoint, pollsets[i]);
}
grpc_endpoint_add_to_pollset(&exec_ctx, server_endpoint, grpc_cq_pollset(cq));
grpc_server_setup_transport(&exec_ctx, server, transport, NULL, server_args);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
grpc_exec_ctx_finish(&exec_ctx);
@ -83,7 +84,7 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
#else // !GPR_SUPPORT_CHANNELS_FROM_FD
void grpc_server_add_insecure_channel_from_fd(grpc_server *server,
grpc_completion_queue *cq,
void *cq,
int fd) {
GPR_ASSERT(0);
}

@ -350,7 +350,7 @@ extern grpc_call_error_to_string_type grpc_call_error_to_string_import;
typedef grpc_channel *(*grpc_insecure_channel_create_from_fd_type)(const char *target, int fd, const grpc_channel_args *args);
extern grpc_insecure_channel_create_from_fd_type grpc_insecure_channel_create_from_fd_import;
#define grpc_insecure_channel_create_from_fd grpc_insecure_channel_create_from_fd_import
typedef void(*grpc_server_add_insecure_channel_from_fd_type)(grpc_server *server, grpc_completion_queue *cq, int fd);
typedef void(*grpc_server_add_insecure_channel_from_fd_type)(grpc_server *server, void *reserved, int fd);
extern grpc_server_add_insecure_channel_from_fd_type grpc_server_add_insecure_channel_from_fd_import;
#define grpc_server_add_insecure_channel_from_fd grpc_server_add_insecure_channel_from_fd_import
typedef void(*grpc_use_signal_type)(int signum);

Loading…
Cancel
Save