summaryrefslogtreecommitdiffstats
path: root/src/lib/asiolink/unix_domain_socket.cc
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2023-12-14 19:16:52 +0100
committerRazvan Becheriu <razvan@isc.org>2024-03-05 08:50:05 +0100
commit1b070fe4b53be34d34bdbfe59ec22d65b27fa982 (patch)
treeff4fa433d4739afe2e9944b46cbab587afd302c5 /src/lib/asiolink/unix_domain_socket.cc
parent[#3271] bump version in configure.ac to 2.5.7 (diff)
downloadkea-1b070fe4b53be34d34bdbfe59ec22d65b27fa982.tar.xz
kea-1b070fe4b53be34d34bdbfe59ec22d65b27fa982.zip
[#3190] use smart pointer to capture IOService instance
Diffstat (limited to 'src/lib/asiolink/unix_domain_socket.cc')
-rw-r--r--src/lib/asiolink/unix_domain_socket.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/asiolink/unix_domain_socket.cc b/src/lib/asiolink/unix_domain_socket.cc
index e5c3dd27ad..12efab3917 100644
--- a/src/lib/asiolink/unix_domain_socket.cc
+++ b/src/lib/asiolink/unix_domain_socket.cc
@@ -25,8 +25,8 @@ public:
/// @brief Constructor.
///
/// @param io_service IO service to be used by the socket class.
- UnixDomainSocketImpl(IOService& io_service)
- : socket_(io_service.getInternalIOService()) {
+ UnixDomainSocketImpl(const IOServicePtr& io_service)
+ : io_service_(io_service), socket_(io_service_->getInternalIOService()) {
}
/// @brief Destructor.
@@ -159,6 +159,9 @@ public:
/// @brief Closes the socket.
void close();
+ /// @brief The IO service used to handle events.
+ IOServicePtr io_service_;
+
/// @brief Instance of the boost asio unix domain socket.
stream_protocol::socket socket_;
};
@@ -280,7 +283,7 @@ UnixDomainSocketImpl::close() {
}
}
-UnixDomainSocket::UnixDomainSocket(IOService& io_service)
+UnixDomainSocket::UnixDomainSocket(const IOServicePtr& io_service)
: impl_(new UnixDomainSocketImpl(io_service)) {
}