You tried?
b.assign(a.Handle.ToInt32());
Also note that you will need to use the WSADuplicateSocket, as you can get both b and a to close the socket and not expect what you are not expecting.
So you need something like:
SOCKET native = WSADuplicateSocket(a.Handle.ToInt32(),...);
b.assign(native);
Full answer (tested)
SOCKET native = a->Handle.ToInt32();
b.assign(boost::asio::ip::tcp::v4(), native);
Now it’s nice to duplicate a socket using WSADuplicateSocket:
source
share