summaryrefslogtreecommitdiffstats
path: root/net/tools/quic/quic_per_connection_packet_writer.cc
blob: f95e0169104a88714b473b180efe77425be9312a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2014 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.

#include "net/tools/quic/quic_per_connection_packet_writer.h"

namespace net {

namespace tools {

QuicPerConnectionPacketWriter::QuicPerConnectionPacketWriter(
    QuicPacketWriter* shared_writer)
    : shared_writer_(shared_writer) {}

QuicPerConnectionPacketWriter::~QuicPerConnectionPacketWriter() {}

WriteResult QuicPerConnectionPacketWriter::WritePacket(
    const char* buffer,
    size_t buf_len,
    const IPAddressNumber& self_address,
    const IPEndPoint& peer_address) {
  return shared_writer_->WritePacket(buffer, buf_len, self_address,
                                     peer_address);
}

bool QuicPerConnectionPacketWriter::IsWriteBlockedDataBuffered() const {
  return shared_writer_->IsWriteBlockedDataBuffered();
}

bool QuicPerConnectionPacketWriter::IsWriteBlocked() const {
  return shared_writer_->IsWriteBlocked();
}

void QuicPerConnectionPacketWriter::SetWritable() {
  shared_writer_->SetWritable();
}

QuicByteCount QuicPerConnectionPacketWriter::GetMaxPacketSize(
    const IPEndPoint& peer_address) const {
  return shared_writer_->GetMaxPacketSize(peer_address);
}

}  // namespace tools

}  // namespace net