Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / net / tools / quic / test_tools / quic_server_peer.cc
blob293c788b81efe317193c187f43aa545ab3ae90d5
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 #include "net/tools/quic/test_tools/quic_server_peer.h"
7 #include "net/tools/quic/quic_dispatcher.h"
8 #include "net/tools/quic/quic_packet_reader.h"
9 #include "net/tools/quic/quic_server.h"
11 namespace net {
12 namespace tools {
13 namespace test {
15 // static
16 bool QuicServerPeer::SetSmallSocket(QuicServer* server) {
17 int size = 1024 * 10;
18 return setsockopt(
19 server->fd_, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) != -1;
22 // static
23 void QuicServerPeer::DisableRecvmmsg(QuicServer* server) {
24 server->use_recvmmsg_ = false;
27 // static
28 QuicDispatcher* QuicServerPeer::GetDispatcher(QuicServer* server) {
29 return server->dispatcher_.get();
32 // static
33 void QuicServerPeer::SetReader(QuicServer* server, QuicPacketReader* reader) {
34 server->packet_reader_.reset(reader);
37 } // namespace test
38 } // namespace tools
39 } // namespace net