Reputation:
How would someone do that? It just blocks until the first connection attempt.
Upvotes: 0
Views: 879
Reputation: 5428
I don't think you can, accept
will block until the first connection arrives and async_accept
won't block at all (and will only handle the first connection as well). However, why do you want this? You can always initiate another accept
once the previous one returned. It's not like you'd miss anything since accept
only removes theses connections from the listening sockets queue.
Upvotes: 6
Reputation: 24164
the boost::asio::ip::tcp::acceptor::accept
method already blocks until a connection is attempted.
Upvotes: 0