roll skia to 4057
[chromium-blink-merge.git] / net / curvecp / server_messenger.h
blobbea21285bf421cfdfb77b67ef51eacac3b65febd
1 // Copyright (c) 2011 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_CURVECP_SERVER_MESSENGER_H_
6 #define NET_CURVECP_SERVER_MESSENGER_H_
7 #pragma once
9 #include <list>
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "net/curvecp/messenger.h"
14 #include "net/curvecp/packetizer.h"
15 #include "net/socket/socket.h"
17 namespace net {
19 // A specialized messenger for listening on a socket, accepting new sockets,
20 // and dispatching io to secondary
21 class ServerMessenger : public Messenger {
22 public:
23 class Acceptor {
24 public:
25 virtual ~Acceptor() {}
26 virtual void OnAccept(ConnectionKey key) = 0;
29 ServerMessenger(Packetizer* packetizer, Acceptor* acceptor);
30 ServerMessenger(ConnectionKey key,
31 Packetizer* packetizer,
32 Acceptor* acceptor);
33 virtual ~ServerMessenger();
35 // Override OnConnection to track incoming connections.
36 virtual void OnConnection(ConnectionKey key) OVERRIDE;
38 private:
39 Acceptor* acceptor_;
40 DISALLOW_COPY_AND_ASSIGN(ServerMessenger);
43 } // namespace net
45 #endif // NET_CURVECP_SERVER_MESSENGER_H_