Mir
|
Responsible for shuttling bytes to and from the server. More...
#include <stream_transport.h>
Classes | |
class | Observer |
Observer of IO status. More... | |
Public Member Functions | |
virtual | ~StreamTransport ()=default |
StreamTransport ()=default | |
StreamTransport (StreamTransport const &)=delete | |
StreamTransport & | operator= (StreamTransport const &)=delete |
virtual void | register_observer (std::shared_ptr< Observer > const &observer)=0 |
Register an IO observer. More... | |
virtual void | receive_data (void *buffer, size_t bytes_requested)=0 |
Read data from the server. More... | |
virtual void | receive_data (void *buffer, size_t bytes_requested, std::vector< Fd > &fds)=0 |
Read data and file descriptors from the server. More... | |
virtual void | send_message (std::vector< uint8_t > const &buffer, std::vector< Fd > const &fds)=0 |
Write message to the server. More... | |
![]() | |
Dispatchable ()=default | |
virtual | ~Dispatchable ()=default |
Dispatchable & | operator= (Dispatchable const &)=delete |
Dispatchable (Dispatchable const &)=delete | |
virtual Fd | watch_fd () const =0 |
Get a poll()able file descriptor. More... | |
virtual bool | dispatch (FdEvents events)=0 |
Dispatch one pending event. More... | |
virtual FdEvents | relevant_events () const =0 |
The set of file-descriptor events this Dispatchable handles. More... | |
Responsible for shuttling bytes to and from the server.
This is a transport providing stream semantics. It does not preserve message boundaries, writes from the remote end are not guaranteed to become available for reading atomically, and local writes are not guaranteed to become available for reading at the remote end atomically.
In practice reads and writes of “small size” will be atomic. See your kernel source tree for a definition of “small size” :).
As it does not preserve message boundaries, partial reads do not discard any unread data waiting for reading. This applies for both binary data and file descriptors.
|
virtualdefault |
|
default |
|
delete |
|
delete |
|
pure virtual |
Read data from the server.
[out] | buffer | Buffer to read into |
[in] | bytes_requested | Number of bytes to read |
A | std::runtime_error if it is not possible to read read_bytes bytes from the server. |
Implemented in mir::client::rpc::StreamSocketTransport.
|
pure virtual |
Read data and file descriptors from the server.
[out] | buffer | Buffer to read into |
[in] | bytes_requested | Number of bytes to read |
[in,out] | fds | File descriptors received in this read. The value of fds.size() determines the number of file descriptors to receive. |
A | std::runtime_error if it is not possible to read read_bytes bytes from the server or if it is not possible to read fds.size() file descriptors from the server. |
Implemented in mir::client::rpc::StreamSocketTransport.
|
pure virtual |
Register an IO observer.
[in] | observer |
|
pure virtual |
Write message to the server.
[in] | buffer | Data to send |
[in] | fds | Fds to send |
A | std::runtime_error if it is not possible to write the full contents of buffer to the server. |
Implemented in mir::client::rpc::StreamSocketTransport.
Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015