]> git.proxmox.com Git - ceph.git/blob - ceph/src/tools/immutable_object_cache/CacheServer.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / tools / immutable_object_cache / CacheServer.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef CEPH_CACHE_CACHE_SERVER_H
5 #define CEPH_CACHE_CACHE_SERVER_H
6
7 #include <boost/asio.hpp>
8 #include <boost/asio/error.hpp>
9
10 #include "Types.h"
11 #include "SocketCommon.h"
12 #include "CacheSession.h"
13
14
15 using boost::asio::local::stream_protocol;
16
17 namespace ceph {
18 namespace immutable_obj_cache {
19
20 class CacheServer {
21 public:
22 CacheServer(CephContext* cct, const std::string& file, ProcessMsg processmsg);
23 ~CacheServer();
24
25 int run();
26 int start_accept();
27 int stop();
28
29 private:
30 void accept();
31 void handle_accept(CacheSessionPtr new_session,
32 const boost::system::error_code& error);
33
34 private:
35 CephContext* cct;
36 boost::asio::io_service m_io_service;
37 ProcessMsg m_server_process_msg;
38 stream_protocol::endpoint m_local_path;
39 stream_protocol::acceptor m_acceptor;
40 };
41
42 } // namespace immutable_obj_cache
43 } // namespace ceph
44
45 #endif