boost::corosio::tcp_server::start
Start accepting connections.
Synopsis
Declared in <boost/corosio/tcp_server.hpp>
void
start();
Description
Launches accept loops for all bound endpoints. Incoming connections are dispatched to idle workers from the pool.
Calling start() on an already‐running server has no effect.
Effects
Creates one accept coroutine per bound endpoint. Each coroutine runs on the server's executor, waiting for connections and dispatching them to idle workers.
Restart Sequence
To restart after stopping, complete the full shutdown cycle:
srv.start();
ioc.run_for( 1s );
srv.stop(); // 1. Signal shutdown
ioc.run(); // 2. Drain remaining completions
srv.join(); // 3. Wait for accept loops
// Now safe to restart
srv.start();
ioc.run();
Exceptions
Name |
Thrown on |
|
If a previous session has not been joined (accept loops still active). |
Created with MrDocs