-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
Crash on NetSocket.swift #606
Comments
Hello, |
i had the same issue. This happens when internet connection is very bad |
Confirm. Happened going in and out of wifi zone, trying to reconnecting frequently. Will see if a catch can be added anywhere. Crash identical to @Goule |
I am facing the same issue, do we have an update on this? |
I've found a similar problem in this thread daltoniam/Starscream#422 The solution is to add a timer. I've been experimenting, and crash seems to happen less often. I can only reproduce when going in and out of bad network outside of the house. However I will do additional testing with emulating bad network to try and catch it in debugger. |
Hi, @mkrn How about changing Line 99 code just like this // for outputStream as OutputStream
// true if the receiver can be written to or if a write must be attempted
// in order to determine if space is available, false otherwise.
guard let outputStream = outputStream, outputStream.hasSpaceAvailable else {
return
}
let length = outputStream.write(buffer.advanced(by: total), maxLength: maxLength - total)
if 0 < length {
total += length
totalBytesOut.mutate { $0 += Int64(length) }
queueBytesOut.mutate { $0 -= Int64(length) }
} else if length == 0 {
break;
} Maybe
|
This problem occurs when I reconnect. // NetSocket.swift
func close(isDisconnected: Bool) {
outputQueue.async {
guard self.runloop != nil else {
return
}
self.deinitConnection(isDisconnected: isDisconnected)
}
} // RTMPConnection
func close(isDisconnected: Bool) {
guard connected || isDisconnected else {
timer = nil
return
}
if !isDisconnected {
uri = nil
}
for (id, stream) in streams {
stream.close()
streams.removeValue(forKey: id)
}
socket.close(isDisconnected: false)
timer = nil
} |
It looks like the crash happens due to a threading issue. |
rtmpConnection.requireNetworkFramework = true @mkrn I have already used According to Apple suggestion:
|
@wolfcon 😲 so no more crashing? |
@mkrn So far so good. No crash because of that. |
Thanks, @wolfcon This can be closed @shogo4405 . |
shogo4405#606 - Do not interrupt recording on reconnect
Hello, Thanks for this solution ! I just tried. But since I put Thanks |
@floriangbh No need any extra code. |
Ok thanks @wolfcon ! But I just tried with the sample project and Youtube RTMP live stream, the sample doesn't work with the |
@floriangbh If the protocol is RTMPS, please set it like this
|
@giotto2012 thanks that was my problem with RTMPS :) |
shogo4405#606 - Do not interrupt recording on reconnect
Hello,
Describe the bug
Crashlytics is reporting a crash on NetSocket.swift line 103 (
NetSocket.doOutputProcess(_:maxLength:)
).To Reproduce
I can't reproduce it but it occured 10 times in 1 week in production (not many users).
Smartphone (please complete the following information):
Exemple of impacted devices :
Additional context
Here is the logs from Crashlytics :
Have you any idea how to fix it ?
Thanks !
The text was updated successfully, but these errors were encountered: