aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/endpoint.h
diff options
context:
space:
mode:
authorGravatar Yuchen Zeng <zyc@google.com>2016-10-24 14:43:12 -0700
committerGravatar Yuchen Zeng <zyc@google.com>2016-10-24 14:43:12 -0700
commite5ec9ac9e2e0195e04c7c99d1c2d9a87f67404fb (patch)
tree1937804d512376063f528f855a807a102a441c74 /src/core/lib/iomgr/endpoint.h
parent5ab4ca5ed838221de17f2cc05a7655dedf516065 (diff)
Add grpc_endpoint_get_socket and GRPC_SOCKET
Diffstat (limited to 'src/core/lib/iomgr/endpoint.h')
-rw-r--r--src/core/lib/iomgr/endpoint.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/endpoint.h b/src/core/lib/iomgr/endpoint.h
index 910a6f6532..22979982e4 100644
--- a/src/core/lib/iomgr/endpoint.h
+++ b/src/core/lib/iomgr/endpoint.h
@@ -39,6 +39,7 @@
#include <grpc/support/time.h>
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/iomgr/sockaddr.h"
/* An endpoint caps a streaming channel between two communicating processes.
Examples may be: a tcp socket, <stdin+stdout>, or some shared memory. */
@@ -59,6 +60,7 @@ struct grpc_endpoint_vtable {
void (*shutdown)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep);
void (*destroy)(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep);
char *(*get_peer)(grpc_endpoint *ep);
+ GRPC_SOCKET *(*get_socket)(grpc_endpoint *ep);
};
/* When data is available on the connection, calls the callback with slices.
@@ -71,6 +73,10 @@ void grpc_endpoint_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
char *grpc_endpoint_get_peer(grpc_endpoint *ep);
+/* Get the socket (file descriptor or SOCKET) used by \a ep. Return NULL if
+ \a ep is not using a socket. */
+GRPC_SOCKET *grpc_endpoint_get_socket(grpc_endpoint *ep);
+
/* Retrieve a reference to the workqueue associated with this endpoint */
grpc_workqueue *grpc_endpoint_get_workqueue(grpc_endpoint *ep);