Skip to content
Snippets Groups Projects
Commit 78fd471b authored by Daniel Müller's avatar Daniel Müller :speech_balloon:
Browse files

Socket wrapper clone function is const now

parent 07fee5b8
No related branches found
No related tags found
No related merge requests found
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
* *
* @return A clone of this TcpListener that shares the same underlying socket. * @return A clone of this TcpListener that shares the same underlying socket.
*/ */
TcpListener clone(); TcpListener clone() const;
}; };
......
...@@ -250,7 +250,7 @@ public: ...@@ -250,7 +250,7 @@ public:
* *
* @return A clone of this TcpStream that shares the same underlying socket. * @return A clone of this TcpStream that shares the same underlying socket.
*/ */
TcpStream clone(); TcpStream clone() const;
friend class TcpListener; friend class TcpListener;
......
...@@ -236,7 +236,7 @@ public: ...@@ -236,7 +236,7 @@ public:
* *
* @return A clone of this UdpSocket that shares the same underlying socket. * @return A clone of this UdpSocket that shares the same underlying socket.
*/ */
UdpSocket clone(); UdpSocket clone() const;
}; };
......
...@@ -136,7 +136,7 @@ void TcpListener::setAutoclose(bool _autoclose) ...@@ -136,7 +136,7 @@ void TcpListener::setAutoclose(bool _autoclose)
autoclose = _autoclose; autoclose = _autoclose;
} }
TcpListener TcpListener::clone() TcpListener TcpListener::clone() const
{ {
TcpListener other{local}; TcpListener other{local};
other.sockfd = sockfd; other.sockfd = sockfd;
......
...@@ -266,7 +266,7 @@ void TcpStream::setAutoclose(bool _autoclose) ...@@ -266,7 +266,7 @@ void TcpStream::setAutoclose(bool _autoclose)
autoclose = _autoclose; autoclose = _autoclose;
} }
TcpStream TcpStream::clone() TcpStream TcpStream::clone() const
{ {
TcpStream other{remote}; TcpStream other{remote};
other.sockfd = sockfd; other.sockfd = sockfd;
......
...@@ -197,7 +197,7 @@ void UdpSocket::setAutoclose(bool _autoclose) ...@@ -197,7 +197,7 @@ void UdpSocket::setAutoclose(bool _autoclose)
autoclose = _autoclose; autoclose = _autoclose;
} }
UdpSocket UdpSocket::clone() UdpSocket UdpSocket::clone() const
{ {
UdpSocket other; UdpSocket other;
other.local = local; other.local = local;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment