Boost C++ Libraries: Ticket #5903: acceptor usage https://svn.boost.org/trac10/ticket/5903 <p> Can't we listen on two different ports using same acceptor object? </p> <p> For eg: </p> <p> func() { </p> <blockquote> <p> boost::asio::ip::tcp::acceptor acceptor_; </p> </blockquote> <p> <em> For port no 5555 </em></p> <blockquote> <p> boost::asio::ip::tcp::resolver resolver(io_service_); boost::asio::ip::tcp::resolver::query query(address, port1); boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query); acceptor_.open(endpoint.protocol()); </p> </blockquote> <p> <em> For port no 6666 </em></p> <blockquote> <p> boost::asio::ip::tcp::resolver::query query2(address, port2); boost::asio::ip::tcp::endpoint endpoint2 = *resolver.resolve(query2); acceptor_.open(endpoint2.protocol()); </p> </blockquote> <p> } </p> <p> When i had tried to run the program i got the following exception: </p> <p> First-chance exception at 0x75f0d36f in HttpServer3.exe: Microsoft C++ exception: boost::exception_detail::clone_impl&lt;boost::exception_detail::error_info_injector&lt;boost::system::system_error&gt; &gt; at memory location 0x0012f554.. </p> <p> Or Do I have a misunderstanding on acceptor concepts... </p> <p> Pl clarify me... </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5903 Trac 1.4.3 Olaf van der Spek <olafvdspek@…> Sat, 01 Oct 2011 12:35:12 GMT <link>https://svn.boost.org/trac10/ticket/5903#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5903#comment:1</guid> <description> <p> AFAIK you need one acceptor per endpoint. Would be nice to support something like acceptor groups. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Tue, 29 May 2012 01:52:34 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5903#comment:2 https://svn.boost.org/trac10/ticket/5903#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> One acceptor is required per listening endpoint, as noted by Olaf. </p> Ticket