Skip to content
Discussion options

You must be logged in to vote

So that impression came from Larix’s behavior, I see.

This is due more to HaishinKit’s design than to the SRT specification. SRTConnection is designed so that the remote connection and the local connection have a 1:1 relationship. For that reason, when the remote connection is closed, the local side is also treated as closed.

You can monitor connection and disconnection events by observing SRTConnection.connected.

private var cancellables: Set<AnyCancellable> = []

Task {
  await connection.$connected.sink {
      if $0 == false {
      // Reconnect in listener mode.
      }
    }.store(in: &cancellables)
  }
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@noho501
Comment options

@shogo4405
Comment options

Answer selected by noho501
@noho501
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
SRT Indicates that an issue, pull request, or discussion is concerns the SRT.
2 participants