From 163509eb5747bffa29810dc3d1eb686fe6fd95b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Sat, 16 Nov 2024 18:56:03 +0100 Subject: [PATCH] fix(WebSocket): re-add assignment operators --- Net/src/WebSocket.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Net/src/WebSocket.cpp b/Net/src/WebSocket.cpp index 80f3dad00..79bfe7713 100644 --- a/Net/src/WebSocket.cpp +++ b/Net/src/WebSocket.cpp @@ -107,6 +107,34 @@ WebSocket& WebSocket::operator = (const Socket& socket) } +#ifdef POCO_NEW_STATE_ON_MOVE + +WebSocket& WebSocket::operator = (Socket&& socket) +{ + if (dynamic_cast(socket.impl())) + Socket::operator = (std::move(socket)); + else + throw InvalidArgumentException("Cannot assign incompatible socket"); + return *this; +} + + +WebSocket& WebSocket::operator = (WebSocket&& socket) +{ + Socket::operator = (std::move(socket)); + return *this; +} + +#endif // POCO_NEW_STATE_ON_MOVE + + +WebSocket& WebSocket::operator = (const WebSocket& socket) +{ + Socket::operator = (socket); + return *this; +} + + int WebSocket::shutdown() { return shutdown(WS_NORMAL_CLOSE);