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

Will this support listener to specific event? #69

Open
flyinghawker opened this issue Jul 15, 2019 · 5 comments
Open

Will this support listener to specific event? #69

flyinghawker opened this issue Jul 15, 2019 · 5 comments
Labels
status-needs-info Waiting for response from reporter - may be deleted if no response

Comments

@flyinghawker
Copy link

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

@natebosch
Copy link
Member

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

@natebosch natebosch added the status-needs-info Waiting for response from reporter - may be deleted if no response label Jul 16, 2019
@tgarm
Copy link

tgarm commented Jul 20, 2019

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

  • connected

  • disconnected

  • message sent

  • message send failed

@jsu93
Copy link

jsu93 commented Jul 22, 2019

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

@natebosch
Copy link
Member

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...

@cTatu
Copy link

cTatu commented Jul 29, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status-needs-info Waiting for response from reporter - may be deleted if no response
Projects
None yet
Development

No branches or pull requests

5 participants