Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Asio] asio objects: initializing after construction
From: Roman Shmelev (rshmelev_at_[hidden])
Date: 2008-10-11 06:11:42

Lets assume I have some kind of map :

        map<int, boost::asio::ip::tcp::acceptor> my_acceptors;
AND map<int, boost::asio::ip::tcp::socket> my_sockets;

I want to extend the maps with new objects, so what is the right way to (?):


I use such code, but not sure it is right:

                // initialize new acceptor
                ip::tcp::endpoint _my_endpoint(ip::tcp::v4(),port);
                ip::tcp::acceptor _acc(_my_ioservice,_my_endpoint);
                my_acceptors[someport_int] = _acc;

                // initialize new socket
                ip::tcp::socket _thesock(_my_ioservice);
                my_sockets[another_int] = _thesock;

                // asycc_accept


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at