• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef QUICHE_QUIC_CORE_BATCH_WRITER_QUIC_SENDMMSG_BATCH_WRITER_H_
6 #define QUICHE_QUIC_CORE_BATCH_WRITER_QUIC_SENDMMSG_BATCH_WRITER_H_
7 
8 #include "quiche/quic/core/batch_writer/quic_batch_writer_base.h"
9 #include "quiche/quic/core/quic_linux_socket_utils.h"
10 
11 namespace quic {
12 
13 class QUIC_EXPORT_PRIVATE QuicSendmmsgBatchWriter : public QuicUdpBatchWriter {
14  public:
15   QuicSendmmsgBatchWriter(std::unique_ptr<QuicBatchWriterBuffer> batch_buffer,
16                           int fd);
17 
18   CanBatchResult CanBatch(const char* buffer, size_t buf_len,
19                           const QuicIpAddress& self_address,
20                           const QuicSocketAddress& peer_address,
21                           const PerPacketOptions* options,
22                           uint64_t release_time) const override;
23 
24   FlushImplResult FlushImpl() override;
25 
26  protected:
27   using CmsgBuilder = QuicMMsgHdr::ControlBufferInitializer;
28   FlushImplResult InternalFlushImpl(size_t cmsg_space,
29                                     const CmsgBuilder& cmsg_builder);
30 };
31 
32 }  // namespace quic
33 
34 #endif  // QUICHE_QUIC_CORE_BATCH_WRITER_QUIC_SENDMMSG_BATCH_WRITER_H_
35