static constexpr uint8_t kReplyFlag = 0x80; // Macro and constexpr to make error values less annoying to write. #define ERR(e) JDWPTRANSPORT_ERROR_ ## e static constexpr jdwpTransportError OK = ERR(NONE);
enumclass TransportState {
kClosed, // Main state.
kListenSetup, // Transient, wait for the state to change before proceeding.
kListening, // Main state.
kOpening, // Transient, wait for the state to change before proceeding.
kOpen, // Main state.
};
// TODO It would be good to get the thread-safety analysis checks working but first we would need to // use something other than std::mutex which does not have the annotations required. class FdForwardTransport : public jdwpTransportEnv { public: explicit FdForwardTransport(jdwpTransportCallback* cb);
~FdForwardTransport();
// Gets the fds from the server side. do_handshake returns whether the transport can skip the // jdwp handshake.
IOResult ReceiveFdsFromSocket(/*out*/bool* do_handshake);
// The allocation/deallocation functions.
jdwpTransportCallback mem_;
// Input from the server;
android::base::unique_fd read_fd_; // GUARDED_BY(state_mutex_); // Output to the server;
android::base::unique_fd write_fd_; // GUARDED_BY(state_mutex_);
// an eventfd passed with the write_fd to the transport that we will 'read' from to get a lock on // the write_fd_. The other side must not hold it for unbounded time.
android::base::unique_fd write_lock_fd_; // GUARDED_BY(state_mutex_);
// Eventfd we will use to wake-up paused reads for close().
android::base::unique_fd wakeup_fd_;
// Socket we will get the read/write fd's from.
android::base::unique_fd listen_fd_;
// Fd we will write close notification to. This is a dup of listen_fd_.
android::base::unique_fd close_notify_fd_;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.