Closed wzJun1 closed 5 months ago
There is also a small problem when using BroadcastExtension for screen sharing.
To turn off screen sharing, use setScreenShare(enabled: false)
. This will only turn off push streaming, but will not turn off iOS screen recording. this will prevent screen sharing from being enabled again.
My temporary solution is:
If you have free time, I hope there is a better solution
Thanks for the report, but I don't think it's the response queue issue. I'll be debugging this one, but this will be tricky.
How often does it fail for you? I can reproduce it like 1 in 10 re-connect attempts.
Many times, none of them succeeded.
As long as the network is disconnected, reconnecting is almost ineffective.
This is my connection configuration:
ConnectOptions(
autoSubscribe: false,
reconnectAttempts: 1000,
reconnectAttemptDelay: 3
)
Before submitting this #306 , it is normal to reconnect.
Comparing logs between success and failure re-connects. Working on this one please give me some time.
Comparing logs between success and failure re-connects. Working on this one please give me some time.
Great! Thank you for your help!
Can you try out if this branch helps ? https://github.com/livekit/client-sdk-swift/pull/308
Can you try out if this branch helps ? #308
There's a problem. I don't know exactly how many seconds it will take. Reconnecting will be effective within about 30 seconds. If it exceeds 30 seconds, it still won't work.
The network is restored after more than 30 seconds. The log is as follows:
2024-01-16T17:34:30+0800 error LiveKitSDK: [] SignalClient._sendRequest(_:) connectionState is .disconnected
2024-01-16T17:34:30+0800 error LiveKitSDK: [] Engine.transport(_:didGenerateIceCandidate:) Failed to send iceCandidate
2024-01-16T17:34:30+0800 error LiveKitSDK: [] SignalClient._sendRequest(_:) connectionState is .disconnected
2024-01-16T17:34:30+0800 error LiveKitSDK: [] Engine.transport(_:didGenerateIceCandidate:) Failed to send iceCandidate
2024-01-16 17:34:30.104876+0800 UniPluginDemo[10623:3594799] baidu maponGetPermissionState--[200]
2024-01-16 17:34:32.051072+0800 UniPluginDemo[10623:3596537] Task <212CB067-8CD6-4E7A-AA4B-98D7D1F32B81>.<1> finished with error [57] Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected"
2024-01-16T17:34:32+0800 error LiveKitSDK : [] WebSocket.urlSession(_:task:didCompleteWithError:) didCompleteWithError: Optional(Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected"
Xcode will always output in the log: Optional(Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected"
To put it simply, #308 only fixes reconnection part of the time. After more than X(X: Unknown, maybe 30, 40, 50 seconds) seconds, he may keep reconnecting, but the reconnection is invalid. The same error continues to be output in the log: Optional(Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected"
Version 1.0.13 does not have this problem. If it is within 1 minute, it will quickly reconnect, if it is after 1 minute, it will be full connect.
For version 1.0.13, Maybe I understand it wrong, but that's how it feels. (Because on my UI if reconnected within 1 minute, the participant will not disappear (maybe participantDidJoin
and participantDidLeave
), if it is reconnected after 1 minute or after 2 minutes, the participant will re-render.)
I think it is that didReceiveLeave
was not called in SignalClient
I added a .leave to the resumed queue status, which temporarily solved the problem, but there seemed to be new troubles. The video track and screen sharing track in the room were not restored.
let isJoinOrReconnect: Bool = {
switch response.message {
case .join, .reconnect, .leave: return true
default: return false
}
}()
Hi thanks for your feedback, I will continue investigating today.
Is there any gain? 😁
Hi thanks for your feedback, I will continue investigating today.
Hello can you try out this branch ? https://github.com/livekit/client-sdk-swift/pull/335
Thx! I will try.
great! it is worked!
Thanks a lot, I will continue to improve network issues.
This is in v2.0.2, I will incrementally make improvements. Closing this for now.
Describe the bug
#306
When the network is disconnected and the network is restored again, the reconnection is abnormal.
My temporary solution:
Although this modification is normal, I feel it will cause other problems.