GithubHelp home page GithubHelp logo

Comments (4)

eidheim avatar eidheim commented on July 20, 2024 1

Thank you again. I replaced the exception throws with onerror calls.

from simple-websocket-server.

eidheim avatar eidheim commented on July 20, 2024

I have to think some more on this, though my initial thought is that the on-methods should be triggered only after a websocket connection is established. I think it should somehow be possible retry opening the connection if these exceptions are triggered.

from simple-websocket-server.

eidheim avatar eidheim commented on July 20, 2024

Or are you running several clients on one io_service.run()?

edit: if so, you are probably right.

from simple-websocket-server.

classix-do avatar classix-do commented on July 20, 2024

Exactly.
I have a bigger application, which starts a Simple-Web-Server to provide dynamic content and opens a long running websocket client connection for data exchange and I wanted them both to share one io_service. I also decoupled the Thread, running the io_service.run() so that it doesn't know anything about the web server or websocket client, which are using the same io_service.

If onerror should only handle errors, which occur during an open connection, then maybe you could make client.start() accept a callback function, which only gets called if an error occurred during connect().

from simple-websocket-server.

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.