mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Add a AdHocSocketHandler::receive_multi overload
With only a single callback.
This commit is contained in:
@@ -542,8 +542,6 @@ class AdHocSocketHandler {
|
||||
* same thing as `primary_callback`, but secondary sockets may need some
|
||||
* different handling.
|
||||
*
|
||||
* TODO: Add an overload with a single callback
|
||||
*
|
||||
* @tparam F A function type in the form of
|
||||
* `void(boost::asio::local::stream_protocol::socket&)`.
|
||||
* @tparam G The same as `F`.
|
||||
@@ -619,6 +617,18 @@ class AdHocSocketHandler {
|
||||
acceptor.reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as the above, but with a single callback for incoming
|
||||
* connections on the primary socket and on secondary sockets.
|
||||
*
|
||||
* @overload
|
||||
*/
|
||||
template <typename F>
|
||||
void receive_multi(std::optional<std::pair<Logger&, bool>> logging,
|
||||
F callback) {
|
||||
receive_multi(logging, callback, callback);
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Used in `receive_multi()` to asynchronously listen for secondary socket
|
||||
|
||||
Reference in New Issue
Block a user