if Receiver not responding, is there any way to get a connection state of GCKSession & GCKCastSession?

Viewed 385

ios version : iOS 10.3 using released ios sdk v3.4

Hi, I'm having trouble getting this 'setSuspendSessionsWhenBackgrounded' option of GCKCastOptions. I did set the option as YES to control RemoteMediaClient of CastSession on MPRemoteCommandCenter in background.

but when i control the RemoteMediaClient using MPRemoteCommandCenter in background, i got this error messages on the logger and castSession will suspend.

[--Logger--] __46-[GCKNSSLSocket sslPrivateInitWithBufferSize:]_block_invoke  [(null)] Error reading from SSL buffer to stream buffer, status: -9805
[--Logger--] __46-[GCKNSSLSocket sslPrivateInitWithBufferSize:]_block_invoke.23  [(null)] Error writing from stream buffer to SSL buffer, status: -9805
[--Logger--] __46-[GCKNSSLSocket sslPrivateInitWithBufferSize:]_block_invoke.23  [(null)] Error writing from stream buffer to SSL buffer, status: -9805
[--Logger--] __46-[GCKNSSLSocket sslPrivateInitWithBufferSize:]_block_invoke.23  [(null)] Error writing from stream buffer to SSL buffer, status: -9805
[--Logger--] __46-[GCKNSSLSocket sslPrivateInitWithBufferSize:]_block_invoke.23  [(null)] Error writing from stream buffer to SSL buffer, status: -9805
[--Logger--] -[GCKCastDeviceConnector heartbeatChannelDidTimeout:]  Receiver not responding to heartbeat, disconnecting.

I got this error, but state of GCKCastSession & state of GCKSession stil was GCKConnectionStateConnected.

when i got the error messages, print connection states of sessionManager.

GCKSessionManager *sessionManager = [GCKCastContext sharedInstance].sessionManager;
sessionManager.hasConnectedSession ==> YES;
sessionManager.hasConnectedCastSession ==> YES;
sessionManager.currentSession.connectionState ==> GCKConnectionStateConnected
sessionManager.currentCastSession.connectionState ==> GCKConnectionStateConnected

i think if GCKSession changed disconnected state or disconnecting state, also set the state of sessions as GCKConnectionStateDisconnected.

1) when i got the error messages, is there any way to get a valid connection state of GCKSession & GCKCastSession?

2) how can i get a notification when GCKSession timedout?

0 Answers
Related