Skip to content

Commit

Permalink
Add stopAllEndpoints API to Swift ConnectionManager
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 677933570
  • Loading branch information
bourdakos1 authored and copybara-github committed Sep 23, 2024
1 parent bdca4aa commit b944d04
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,18 @@ public class ConnectionManager {
withCompletionHandler: completionHandler
)
}

/// Disconnects from, and removes all traces of, all connected and/or discovered endpoints.
///
/// This call is expected to be preceded by a call to stop advertising or discovery as needed.
/// After calling this method, no further operations with remote endpoints will be possible until
/// a new call to start advertising or discovery.
///
/// - Parameters:
/// - completionHandler: Called when all endpoints have been disconnected and removed.
public func stopAllEndpoints(completionHandler: ((Error?) -> Void)? = nil) {
GNCCoreAdapter.shared.stopAllEndpoints(completionHandler: completionHandler)
}
}

extension ConnectionManager: InternalPayloadDelegate {
Expand Down

0 comments on commit b944d04

Please sign in to comment.