[Boost-bugs] [Boost C++ Libraries] #5903: acceptor usage

Subject: [Boost-bugs] [Boost C++ Libraries] #5903: acceptor usage
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-16 11:19:54


#5903: acceptor usage
------------------------------------+---------------------------------------
 Reporter: vickram.1988@… | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
------------------------------------+---------------------------------------
 Can't we listen on two different ports using same acceptor object?

 For eg:

 func()
 {
   boost::asio::ip::tcp::acceptor acceptor_;

 // For port no 5555
   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());

 // For port no 6666
   boost::asio::ip::tcp::resolver::query query2(address, port2);
   boost::asio::ip::tcp::endpoint endpoint2 = *resolver.resolve(query2);
   acceptor_.open(endpoint2.protocol());
 }

 When i had tried to run the program i got the following exception:

 First-chance exception at 0x75f0d36f in HttpServer3.exe: Microsoft C++
 exception:
 boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error>
> at memory location 0x0012f554..

 Or Do I have a misunderstanding on acceptor concepts...

 Pl clarify me...

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5903>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC