-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we get any callback when Bidirectional stream gets disconnected by the server. #1841
Comments
You can add a callback to the mobileAsMicBidiStream.whenSuccess { status in
// ...
} |
@glbrntt The bidirectional stream
|
What are you trying to achieve?
We are connected to our backend service and backend exposes a bidirectional stream which used to for continuous audio streaming. We are facing an problem that this bidirectional stream automatically closes by the backend service by default it gets disconnected if we keep the stream idle for 30 sec(configuration in our backend). So we wont keep the stream idle for more than 30sec.
Still in some rare scenario the stream gets disconnect by the backend service, My question is is there any way to client to get to know about the stream disconnection via any callback? When the service disconnects we get a delegate callback, But I am unable get any details on callback option when the stream disconnects.
Here is our backend protos
service Mic { rpc AudioStream(stream MicRequest) returns (stream MicResponse); rpc SendNoteType(NoteType) returns (google.protobuf.Empty); }
Here is the swift code that connects to the stream
mobileAsMicBidiStream = mobileAsMicClient.audioStream(handler: { response in self.serialResponseQueue.async { self.micResponseHandler.handleMicResponse(micResponse: response, stream: self) } })
What have you tried so far?
Tried searching for any callbacks on stream disconnection but couldn't find any details on that.
The text was updated successfully, but these errors were encountered: