GithubHelp home page GithubHelp logo

Comments (7)

robertjpayne avatar robertjpayne commented on June 15, 2024

@panthesingh Do you have an example case you can upload that exhibits this issue? The fact it's passing all of the autobahn tests and I just tested it myself and it closes connections just fine is peculiar.

What makes you believe it's not closing the connections? Is it not sending a delegate message or is the server not getting a notification that it's been closed?

Also are you immediately destroying the PSWebSocket instance while the close command is sent? Unlike SocketRocket PSWebSocket does not retain itself while the connection is open so if you dealloc it immediately after calling close it will drop the socket connection likely before the close command is transported.

If the connection is dropped unexpectedly the other end normally wont know until it attempts to write another message.

from pocketsocket.

robertjpayne avatar robertjpayne commented on June 15, 2024

@panthesingh Can you provide a full example of your Objective-C class? Still hard to tell if you're potentially deallocing the PSWebSocket instance.

from pocketsocket.

robertjpayne avatar robertjpayne commented on June 15, 2024

By default I thought unless you specify a storage strength @properties are assign which would mean the instance is getting immediately deallocated potentially. I could be wrong here though.

Can you change @property (nonatomic) to @property (strong, nonatomic) and see if it helps? If not I'll dig into this a bit more later today.

from pocketsocket.

robertjpayne avatar robertjpayne commented on June 15, 2024

Hey @panthesingh

If you could zip up and send your sample project to robert[at]zwopple[dot]com that would be amazing.

The run loop should never get cleaned up, it's shared across all PSWebSocket instances and never gets removed.

from pocketsocket.

robertjpayne avatar robertjpayne commented on June 15, 2024

@panthesingh Ok can confirm it's not closing properly. So strange as the Autobahn tests are passing 100%.. will dig into it a bit further in regards to the websocket RFC and see if it's the client or server that is being fishy.

from pocketsocket.

robertjpayne avatar robertjpayne commented on June 15, 2024

@panthesingh This is now resolved in master. It was a really simple fix. Also in addition to sending the close to the server it will enforce a 30 second limit after which the client will forcefully drop the socket connection.

from pocketsocket.

robertjpayne avatar robertjpayne commented on June 15, 2024

Given it was an exec bad access the run loop was getting dealloced somehow, to hopefully prevent it I stored a strong reference to the run loop and that should hopefully resolve it.

If it still ever crashes let me know

from pocketsocket.

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.