From 5f387071d339892ebed5accba92f91f997396476 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 21 Jul 2019 16:56:55 +0100 Subject: Add a method for swapping user I/O handlers. --- src/inspsocket.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/inspsocket.cpp') diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 684ee051d..44fe7b72b 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -541,3 +541,17 @@ size_t StreamSocket::getSendQSize() const } return ret; } + +void StreamSocket::SwapInternals(StreamSocket& other) +{ + if (type != other.type) + return; + + EventHandler::SwapInternals(other); + std::swap(closeonempty, other.closeonempty); + std::swap(closing, other.closing); + std::swap(error, other.error); + std::swap(iohook, other.iohook); + std::swap(recvq, other.recvq); + std::swap(sendq, other.sendq); +} -- cgit v1.2.3