Skip to content

Can we get any callback when Bidirectional stream gets disconnected by the server. #1841

@araisuki

Description

@araisuki

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/supportAdopter support requests.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions