Giter VIP home page Giter VIP logo

Comments (7)

tidwall avatar tidwall commented on July 23, 2024

Thanks for reporting this @netgfx. I haven't encountered this issue before now. I would like to reproduce it. Does this crash happen in the simulator, on the device, or both? Are you running Xcode 7.3.1?

from swiftwebsocket.

netgfx avatar netgfx commented on July 23, 2024

Yes using xcode 7.3.1 and iOS device (only happens on device) 9.3.2/9.3.1
Over wifi or cellular. Socket is open and receiving messages from python but App is on background.
The inactivity must be over 15' - 20'
The line reported by the debugger is this:
return pthread_cond_timedwait(&self.cond, &self.mutex, &ts)

from swiftwebsocket.

tidwall avatar tidwall commented on July 23, 2024

I haven't been able to reproduce this crash yet.

What I've tried was I created a simple app that loads a websocket from viewDidLoad, and receives small messages (around 50 bytes) 5 times a second and print these messages to the Xcode console.

After about 10 seconds I send the app to the background by pressing the Home button. The app receives few more messages (around 5) and prints these to the console. After a few minutes my iphone goes to sleep. I wait about 30 minutes then I awaken the device and bring the app to the foreground. The websocket immediately receives the event Network(The operation couldn’t be completed. Socket is not connected). But there isn't a crash.

from swiftwebsocket.

netgfx avatar netgfx commented on July 23, 2024

Interesting, the thing is this crash doesn't appear consistently but it appears. So I don't have an exact reproduction route. In my app I have a socket that opens on a wss:// protocol server, and subscribes to a thread (room). Then the app goes to the background and after X-amount of time it is brought back to foreground and then it sometimes crashes.
I have to add that I have never experienced this when the device is connected to the Mac OS via cable. It only happened when the device is not connected via cable.

from swiftwebsocket.

tidwall avatar tidwall commented on July 23, 2024

That's helpful info. Couple more questions if you don't mind. Are you creating the websocket from the UI thread? Does this happen in debug or release? And do you have any background modes set in the Info.plist file?

from swiftwebsocket.

netgfx avatar netgfx commented on July 23, 2024
  • The socket creation is indeed created on the main thread.
  • This is happening mostly on release
  • Not sure what background modes are, so I presume I don't have anything declared there.

from swiftwebsocket.

tidwall avatar tidwall commented on July 23, 2024

Hi Michael.

I'm sorry for responding after so long.

I'm going to close the issue for now because there's been a few updates to the project since this issue has first opened. But if this is still a problem please feel free to reopen the issue or create a new one.

Thanks for supporting the project.

from swiftwebsocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.