// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
+#include <boost/asio/error.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/read.hpp>
+#include <boost/asio/write.hpp>
#include <boost/bind/bind.hpp>
#include "CacheClient.h"
#include "common/Cond.h"
"immutable_object_cache_client_dedicated_thread_num");
if (m_worker_thread_num != 0) {
- m_worker = new boost::asio::io_service();
- m_worker_io_service_work = new boost::asio::io_service::work(*m_worker);
+ m_worker = new boost::asio::io_context();
+ m_worker_io_service_work = new boost::asio::io_context::work(*m_worker);
for (uint64_t i = 0; i < m_worker_thread_num; i++) {
std::thread* thd = new std::thread([this](){m_worker->run();});
m_worker_threads.push_back(thd);
#define CEPH_CACHE_CACHE_CLIENT_H
#include <atomic>
-#include <boost/asio.hpp>
-#include <boost/asio/error.hpp>
+#include <boost/asio/io_context.hpp>
+#include <boost/asio/local/stream_protocol.hpp>
#include <boost/algorithm/string.hpp>
#include "include/ceph_assert.h"
#include "SocketCommon.h"
-using boost::asio::local::stream_protocol;
-
namespace ceph {
namespace immutable_obj_cache {
+using boost::asio::local::stream_protocol;
+
class CacheClient {
public:
CacheClient(const std::string& file, CephContext* ceph_ctx);
private:
CephContext* m_cct;
- boost::asio::io_service m_io_service;
- boost::asio::io_service::work m_io_service_work;
+ boost::asio::io_context m_io_service;
+ boost::asio::io_context::work m_io_service_work;
stream_protocol::socket m_dm_socket;
stream_protocol::endpoint m_ep;
std::shared_ptr<std::thread> m_io_thread;
std::atomic<bool> m_session_work;
uint64_t m_worker_thread_num;
- boost::asio::io_service* m_worker;
+ boost::asio::io_context* m_worker;
std::vector<std::thread*> m_worker_threads;
- boost::asio::io_service::work* m_worker_io_service_work;
+ boost::asio::io_context::work* m_worker_io_service_work;
std::atomic<bool> m_writing;
std::atomic<bool> m_reading;
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
+#include <boost/asio/error.hpp>
+#include <boost/asio/placeholders.hpp>
#include <boost/bind/bind.hpp>
#include "common/debug.h"
#include "common/ceph_context.h"
#ifndef CEPH_CACHE_CACHE_SERVER_H
#define CEPH_CACHE_CACHE_SERVER_H
-#include <boost/asio.hpp>
-#include <boost/asio/error.hpp>
+#include <boost/asio/io_context.hpp>
+#include <boost/asio/local/stream_protocol.hpp>
#include "Types.h"
#include "SocketCommon.h"
#include "CacheSession.h"
-using boost::asio::local::stream_protocol;
-
namespace ceph {
namespace immutable_obj_cache {
+using boost::asio::local::stream_protocol;
+
class CacheServer {
public:
CacheServer(CephContext* cct, const std::string& file, ProcessMsg processmsg);
private:
CephContext* cct;
- boost::asio::io_service m_io_service;
+ boost::asio::io_context m_io_service;
ProcessMsg m_server_process_msg;
stream_protocol::endpoint m_local_path;
stream_protocol::acceptor m_acceptor;
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
+#include <boost/asio/error.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/read.hpp>
+#include <boost/asio/write.hpp>
#include <boost/bind/bind.hpp>
#include "common/debug.h"
#include "common/ceph_context.h"
namespace ceph {
namespace immutable_obj_cache {
-CacheSession::CacheSession(io_service& io_service,
+CacheSession::CacheSession(io_context& io_service,
ProcessMsg processmsg,
CephContext* cct)
: m_dm_socket(io_service),
#ifndef CEPH_CACHE_SESSION_H
#define CEPH_CACHE_SESSION_H
-#include <boost/asio.hpp>
-#include <boost/asio/error.hpp>
+#include <boost/asio/io_context.hpp>
+#include <boost/asio/local/stream_protocol.hpp>
#include "Types.h"
#include "SocketCommon.h"
-using boost::asio::local::stream_protocol;
-using boost::asio::io_service;
-
namespace ceph {
namespace immutable_obj_cache {
+using boost::asio::local::stream_protocol;
+using boost::asio::io_context;
+
class CacheSession : public std::enable_shared_from_this<CacheSession> {
public:
- CacheSession(io_service& io_service, ProcessMsg process_msg,
+ CacheSession(io_context& io_service, ProcessMsg process_msg,
CephContext* ctx);
~CacheSession();
stream_protocol::socket& socket();