From 78fd471bd6f7ef4f0919a63f4f20d78119b336ca Mon Sep 17 00:00:00 2001
From: Daniel M <daniel.q.mueller@stud.h-da.de>
Date: Sat, 22 May 2021 00:48:56 +0200
Subject: [PATCH] Socket wrapper clone function is const now

---
 inc/tcplistener.hpp | 2 +-
 inc/tcpstream.hpp   | 2 +-
 inc/udpsocket.hpp   | 2 +-
 src/tcplistener.cpp | 2 +-
 src/tcpstream.cpp   | 2 +-
 src/udpsocket.cpp   | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/inc/tcplistener.hpp b/inc/tcplistener.hpp
index 79582cc..6b8380b 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 72f9af5..a51b4ad 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 6386b02..e76dfe9 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 dc5262f..4bda937 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 8f6e5fd..3cd3145 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 9ef39b4..8137cb6 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;
-- 
GitLab