// Copyright 2022 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef QUICHE_QUIC_IO_QUIC_EVENT_LOOP_H_ #define QUICHE_QUIC_IO_QUIC_EVENT_LOOP_H_ #include <cstdint> #include <memory> #include "absl/base/attributes.h" #include "quiche/quic/core/io/socket.h" #include "quiche/quic/core/quic_alarm_factory.h" #include "quiche/quic/core/quic_clock.h" namespace quic { // A bitmask indicating a set of I/O events. QuicSocketEventMask; inline constexpr QuicSocketEventMask kSocketEventReadable = …; inline constexpr QuicSocketEventMask kSocketEventWritable = …; inline constexpr QuicSocketEventMask kSocketEventError = …; class QuicEventLoop; // A listener associated with a file descriptor. class QuicSocketEventListener { … }; // An abstraction for an event loop that can handle alarms and notify the // listener about I/O events occuring to the registered UDP sockets. // // Note on error handling: while most of the methods below return a boolean to // indicate whether the operation has succeeded or not, some will QUIC_BUG // instead. class QuicEventLoop { … }; // A factory object for the event loop. Every implementation is expected to have // a static singleton instance. class QuicEventLoopFactory { … }; } // namespace quic #endif // QUICHE_QUIC_IO_QUIC_EVENT_LOOP_H_