aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext
diff options
context:
space:
mode:
authorGravatar Adam Michalik <xyzzyz@google.com>2016-05-20 16:13:32 -0700
committerGravatar Adam Michalik <xyzzyz@google.com>2016-06-07 15:09:19 -0700
commitbf10c82bf805a6d9b87813650e581113c4c7b3ff (patch)
tree9b197df812f1df5e21bd948ab4b439e6821e3c52 /src/core/ext
parent4023382294f732fe8fa1ff8e10a3eed68c154ff0 (diff)
implement support for adding external fd to server
Diffstat (limited to 'src/core/ext')
-rw-r--r--src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c
index 012fbb432a..1946f394d4 100644
--- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c
+++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c
@@ -37,6 +37,14 @@
#include <grpc/grpc.h>
#include <grpc/grpc_posix.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/tcp_posix.h"
+#include "src/core/lib/surface/server.h"
void grpc_server_add_insecure_channel_from_fd(grpc_server *server, int fd) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -46,12 +54,12 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server *server, int fd) {
grpc_endpoint *server_endpoint = grpc_tcp_create(
grpc_fd_create(fd, name), GRPC_TCP_DEFAULT_READ_SLICE_SIZE, name);
- grpc_channel_args *server_args = grpc_server_get_channel_args(server);
+ const grpc_channel_args *server_args = grpc_server_get_channel_args(server);
grpc_transport *transport = grpc_create_chttp2_transport(
&exec_ctx, server_args, server_endpoint, 0 /* is_client */);
grpc_server_setup_transport(&exec_ctx, server, transport, server_args);
-
-
+ grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL, 0);
+ grpc_exec_ctx_finish(&exec_ctx);
}