ConnectionManager+Delegates.swift 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright 2021, gRPC Authors All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. internal protocol ConnectionManagerConnectivityDelegate {
  17. /// The state of the connection changed.
  18. ///
  19. /// - Parameters:
  20. /// - connectionManager: The connection manager reporting the change of state.
  21. /// - oldState: The previous `ConnectivityState`.
  22. /// - newState: The current `ConnectivityState`.
  23. func connectionStateDidChange(
  24. _ connectionManager: ConnectionManager,
  25. from oldState: ConnectivityState,
  26. to newState: ConnectivityState
  27. )
  28. /// The connection is quiescing.
  29. ///
  30. /// - Parameters:
  31. /// - connectionManager: The connection manager whose connection is quiescing.
  32. func connectionIsQuiescing(_ connectionManager: ConnectionManager)
  33. }
  34. internal protocol ConnectionManagerHTTP2Delegate {
  35. /// An HTTP/2 stream was closed.
  36. ///
  37. /// - Parameters:
  38. /// - connectionManager: The connection manager reporting the closed stream.
  39. func streamClosed(_ connectionManager: ConnectionManager)
  40. /// The connection received a SETTINGS frame containing SETTINGS_MAX_CONCURRENT_STREAMS.
  41. ///
  42. /// - Parameters:
  43. /// - connectionManager: The connection manager which received the settings update.
  44. /// - maxConcurrentStreams: The value of SETTINGS_MAX_CONCURRENT_STREAMS.
  45. func receivedSettingsMaxConcurrentStreams(
  46. _ connectionManager: ConnectionManager,
  47. maxConcurrentStreams: Int
  48. )
  49. }