diff --git a/inc/tcplistener.hpp b/inc/tcplistener.hpp index 79582cc25f221b5915e8d56be7d5f034d12c2b04..6b8380bbe6531081d96c8d2a72c2ced9f36a8467 100644 --- a/inc/tcplistener.hpp +++ b/inc/tcplistener.hpp @@ -139,7 +139,7 @@ public: * * @return A clone of this TcpListener that shares the same underlying socket. */ - TcpListener clone(); + TcpListener clone() const; }; diff --git a/inc/tcpstream.hpp b/inc/tcpstream.hpp index 72f9af5947aa07a8fc291cfcca285e1e8e435da5..a51b4ad60d9ccedf2c1ead4e1c0c3b02daf3473d 100644 --- a/inc/tcpstream.hpp +++ b/inc/tcpstream.hpp @@ -250,7 +250,7 @@ public: * * @return A clone of this TcpStream that shares the same underlying socket. */ - TcpStream clone(); + TcpStream clone() const; friend class TcpListener; diff --git a/inc/udpsocket.hpp b/inc/udpsocket.hpp index 6386b022c61b21df7e938c340756246da8816123..e76dfe9409573c611e0e3364ac8844e1f5871abe 100644 --- a/inc/udpsocket.hpp +++ b/inc/udpsocket.hpp @@ -236,7 +236,7 @@ public: * * @return A clone of this UdpSocket that shares the same underlying socket. */ - UdpSocket clone(); + UdpSocket clone() const; }; diff --git a/src/tcplistener.cpp b/src/tcplistener.cpp index dc5262f8ae1654d85762fa46eab49ce017593937..4bda937ae76cd4a639e68c64d9f1451ac153a1ed 100644 --- a/src/tcplistener.cpp +++ b/src/tcplistener.cpp @@ -136,7 +136,7 @@ void TcpListener::setAutoclose(bool _autoclose) autoclose = _autoclose; } -TcpListener TcpListener::clone() +TcpListener TcpListener::clone() const { TcpListener other{local}; other.sockfd = sockfd; diff --git a/src/tcpstream.cpp b/src/tcpstream.cpp index 8f6e5fd27a15b44c74b903b7d1849c002264035e..3cd3145d4bec9bf0a341c73ee37efe8f92deff61 100644 --- a/src/tcpstream.cpp +++ b/src/tcpstream.cpp @@ -266,7 +266,7 @@ void TcpStream::setAutoclose(bool _autoclose) autoclose = _autoclose; } -TcpStream TcpStream::clone() +TcpStream TcpStream::clone() const { TcpStream other{remote}; other.sockfd = sockfd; diff --git a/src/udpsocket.cpp b/src/udpsocket.cpp index 9ef39b484b157e86d277106580dbf93ad7e5b80c..8137cb6c98345a513699c9fac91783a372d1cd48 100644 --- a/src/udpsocket.cpp +++ b/src/udpsocket.cpp @@ -197,7 +197,7 @@ void UdpSocket::setAutoclose(bool _autoclose) autoclose = _autoclose; } -UdpSocket UdpSocket::clone() +UdpSocket UdpSocket::clone() const { UdpSocket other; other.local = local;