I have two classes (Negotiator, Client), both have their own boost :: asio :: ip :: tcp :: socket. Is there any way to pass the socket object to the client after negotiation is complete. I hope to do something like this:
boost::asio::ip::tcp::socket sock1(io); //... boost::asio::ip::tcp::socket sock2; sock2.assign(sock1);
This operation should ensure that the connection is not closed when sock1 is destroyed.
I think you could:
But:
Create a socket on the heap (new) and pass the pointer from the negotiator to the client.
Starting with the current version of Boost, you will now receive a handle with
boost::asio::ip::tcp::socket::my_socket; auto my_handle = my_socket.native_handle();
instead of the old native() member function.
native()
Source: https://habr.com/ru/post/1343783/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1343778/c-application-is-it-possible-to-pass-accepted-tcp-connection-from-one-process-to-another&usg=ALkJrhin-yRKY1QRfXWCU80vLMz4dSB15gInstalling intl on OS X 10.6.6: Invalid library (maybe not a PHP library) intl.so - phpC ++ Boost.ASIO: transferring a received TCP connection from one open socket to another using the Windows API (when working with Linux APIs)? - c ++https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1343781/append-multiple-similar-xml-nodes-to-xml-document&usg=ALkJrhjWahoInJsTRexyV-d_5qcKobHL9AJDK Logging API - javaregex line when breaking first line - phpBind BYTEA to PGSQL PDO Prepared report in PHP5 - phpXmlReader AppendChild does not add the same child value - c #How to send RTP to Android? - androidUse the triangle triangulation of a triangle to triangulate a polygon - c ++All Articles