aboutsummaryrefslogtreecommitdiff
path: root/src/core/lib/iomgr/event_engine_shims/endpoint.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/iomgr/event_engine_shims/endpoint.h')
-rw-r--r--src/core/lib/iomgr/event_engine_shims/endpoint.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/event_engine_shims/endpoint.h b/src/core/lib/iomgr/event_engine_shims/endpoint.h
index bc018f1e4d..0b5bc84a66 100644
--- a/src/core/lib/iomgr/event_engine_shims/endpoint.h
+++ b/src/core/lib/iomgr/event_engine_shims/endpoint.h
@@ -15,6 +15,8 @@
#define GRPC_SRC_CORE_LIB_IOMGR_EVENT_ENGINE_SHIMS_ENDPOINT_H
#include <grpc/support/port_platform.h>
+#include <memory>
+
#include <grpc/event_engine/event_engine.h>
#include "src/core/lib/iomgr/endpoint.h"
@@ -31,6 +33,20 @@ grpc_endpoint* grpc_event_engine_endpoint_create(
/// Returns true if the passed endpoint is an event engine shim endpoint.
bool grpc_is_event_engine_endpoint(grpc_endpoint* ep);
+/// Returns the wrapped event engine endpoint if the given grpc_endpoint is an
+/// event engine shim endpoint. Otherwise it returns nullptr.
+EventEngine::Endpoint* grpc_get_wrapped_event_engine_endpoint(
+ grpc_endpoint* ep);
+
+/// Transfers ownership of the wrapped event engine endpoint if the given
+/// grpc_endpoint is an event engine shim endpoint. Otherwise it returns
+/// nullptr. If the passed ep wraps an event_engine endpoint, then after this
+/// call, the memory location holding by the passed ep is free'ed.
+/// Its safe to call this function only when there are no pending reads/writes
+/// on the endpoint.
+std::unique_ptr<EventEngine::Endpoint> grpc_take_wrapped_event_engine_endpoint(
+ grpc_endpoint* ep);
+
/// Destroys the passed in event engine shim endpoint and schedules the
/// asynchronous execution of the on_release_fd callback. The int pointer fd is
/// set to the underlying endpoint's file descriptor.