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_
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"
19 // A specialized messenger for listening on a socket, accepting new sockets,
20 // and dispatching io to secondary
21 class ServerMessenger
: public Messenger
{
25 virtual ~Acceptor() {}
26 virtual void OnAccept(ConnectionKey key
) = 0;
29 ServerMessenger(Packetizer
* packetizer
, Acceptor
* acceptor
);
30 ServerMessenger(ConnectionKey key
,
31 Packetizer
* packetizer
,
33 virtual ~ServerMessenger();
35 // Override OnConnection to track incoming connections.
36 virtual void OnConnection(ConnectionKey key
) OVERRIDE
;
40 DISALLOW_COPY_AND_ASSIGN(ServerMessenger
);
45 #endif // NET_CURVECP_SERVER_MESSENGER_H_