Code Monkey home page Code Monkey logo

Comments (5)

tgarm avatar tgarm commented on August 17, 2024 2

I guess 'events' here might be 'exceptions'. Such as:

  • connected

  • disconnected

  • message sent

  • message send failed

from web_socket_channel.

cTatu avatar cTatu commented on August 17, 2024 2

Specific event listener is necessary in some scenarios. Hope to have it.

I made an implementation here of this npm wrapper over the IOWebSocketChannel. Implements requests and messages based on events like socket.io

from web_socket_channel.

natebosch avatar natebosch commented on August 17, 2024

What do you mean by "event"? A web socket is a duplex communication channel - it doesn't define anything in terms of "event".

The Stream API doc talk about "events" - in as much as you can get the stream for a web socket channel you can deal with events in any way you can with a stream, but I don't know what "specific" would mean in that context.

Perhaps you're meaning events like DOM events? In that case you'll want to look at the APIs around dart:html

from web_socket_channel.

jsu93 avatar jsu93 commented on August 17, 2024

connected is the onOpen event, but I didn't see any api about this in this package.

https://api.dartlang.org/stable/2.4.0/dart-html/WebSocket/onOpen.html

from web_socket_channel.

natebosch avatar natebosch commented on August 17, 2024

I don't think this package is not intended to expose the low level plumbing - for that use the WebSocket directly. This package is wrapping an existing WebSocket and exposing it as a StreamChannel.

We do expose at least a little beyond the StreamChannel interface, with things like closeCode, but I'm not sure how much we'd want to expand that...

from web_socket_channel.

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.