diff options
author | Peter Powell <petpow@saberuk.com> | 2019-07-21 16:56:55 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-07-21 16:57:19 +0100 |
commit | 5f387071d339892ebed5accba92f91f997396476 (patch) | |
tree | c91e7f11859dc267b8c2b946f159abe28d558038 /src/inspsocket.cpp | |
parent | 62f6e56e158a3c147cd1395dab790f918ce2d1b4 (diff) |
Add a method for swapping user I/O handlers.
Diffstat (limited to 'src/inspsocket.cpp')
-rw-r--r-- | src/inspsocket.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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); +} |