1 // Copyright 2013 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.
5 #ifndef NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
6 #define NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_
8 #include "base/basictypes.h"
9 #include "net/base/ip_endpoint.h"
10 #include "net/quic/quic_packet_writer.h"
18 // Default packet writer which wraps QuicSocketUtils WritePacket.
19 class QuicDefaultPacketWriter
: public QuicPacketWriter
{
21 explicit QuicDefaultPacketWriter(int fd
);
22 ~QuicDefaultPacketWriter() override
;
25 WriteResult
WritePacket(const char* buffer
,
27 const IPAddressNumber
& self_address
,
28 const IPEndPoint
& peer_address
) override
;
29 bool IsWriteBlockedDataBuffered() const override
;
30 bool IsWriteBlocked() const override
;
31 void SetWritable() override
;
33 void set_fd(int fd
) { fd_
= fd
; }
36 void set_write_blocked(bool is_blocked
) {
37 write_blocked_
= is_blocked
;
39 int fd() { return fd_
; }
45 DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter
);
51 #endif // NET_TOOLS_QUIC_QUIC_DEFAULT_PACKET_WRITER_H_