#include <iomgr_engine.h>
Public Member Functions | |
const ResolvedAddress & | GetLocalAddress () const override |
const ResolvedAddress & | GetPeerAddress () const override |
void | Read (std::function< void(absl::Status)> on_read, SliceBuffer *buffer, const ReadArgs *args) override |
void | Write (std::function< void(absl::Status)> on_writable, SliceBuffer *data, const WriteArgs *args) override |
~IomgrEndpoint () override | |
![]() | |
virtual | ~Endpoint ()=default |
Definition at line 47 of file iomgr_engine.h.
|
override |
|
overridevirtual |
|
overridevirtual |
Returns an address in the format described in DNSResolver. The returned values are expected to remain valid for the life of the Endpoint.
Implements grpc_event_engine::experimental::EventEngine::Endpoint.
|
overridevirtual |
Reads data from the Endpoint.
When data is available on the connection, that data is moved into the buffer, and the on_read callback is called. The caller must ensure that the callback has access to the buffer when executed later. Ownership of the buffer is not transferred. Valid slices may be placed into the buffer even if the callback is invoked with a non-OK Status.
There can be at most one outstanding read per Endpoint at any given time. An outstanding read is one in which the on_read callback has not yet been executed for some previous call to Read. If an attempt is made to call Read while a previous read is still outstanding, the EventEngine must abort.
For failed read operations, implementations should pass the appropriate statuses to on_read. For example, callbacks might expect to receive CANCELLED on endpoint shutdown.
Implements grpc_event_engine::experimental::EventEngine::Endpoint.
|
overridevirtual |
Writes data out on the connection.
on_writable is called when the connection is ready for more data. The Slices within the data buffer may be mutated at will by the Endpoint until on_writable is called. The data SliceBuffer will remain valid after calling Write, but its state is otherwise undefined. All bytes in data must have been written before calling on_writable unless an error has occurred.
There can be at most one outstanding write per Endpoint at any given time. An outstanding write is one in which the on_writable callback has not yet been executed for some previous call to Write. If an attempt is made to call Write while a previous write is still outstanding, the EventEngine must abort.
For failed write operations, implementations should pass the appropriate statuses to on_writable. For example, callbacks might expect to receive CANCELLED on endpoint shutdown.
Implements grpc_event_engine::experimental::EventEngine::Endpoint.