Skip to content
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

if you socket resart many time,cpu is very busy and Forever and ever #995

Open
gaojlieMan opened this issue Dec 15, 2023 · 0 comments
Open
Labels

Comments

@gaojlieMan
Copy link

Describe the bug

A clear and concise description of what the bug is.

Steps to Reproduce

for example:

socket = WebSocket(request: request,useCustomEngine: false)
webSocket?.connect()
webSocket?.connect()
webSocket?.connect()
webSocket?.connect()

//your document: NativeEngine -> Repeated call method -> doRead() and Endless loop

"private func doRead() {
task?.receive { [weak self] (result) in
switch result {
case .success(let message):
switch message {
case .string(let string):
self?.broadcast(event: .text(string))
case .data(let data):
self?.broadcast(event: .binary(data))
@unknown default:
break
}
break
case .failure(let error):
self?.broadcast(event: .error(error))
}
self?.doRead()
}
}"

Expected behavior

Cpu 100%

Environment:

  • OS/Version: [e.g. iOS/17.0.1.3]
  • Starscream Version [last]
  • Xcode version [e.g. 15]

Additional context

App can not work beacuse the cpu is occupied.

@gaojlieMan gaojlieMan added the bug label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant